Skip to content

Commit

Permalink
add google auth to CI, fix np array in primer3 input
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjaynagi committed Sep 26, 2024
1 parent fa3fd50 commit 8699e1d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/github-action-AgamPrimer-funestus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ jobs:
poetry install
poetry run python -m ipykernel install --user --name AnoPrimer
- id: 'auth'
name: 'Set up Google Cloud authentication'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'

- name: 'Set up Google Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'

- name: 'Check gcloud CLI'
run: 'gcloud info'

- name: Run notebooks
run: |
poetry run papermill notebooks/AnoPrimer-long.ipynb qPCR_run.ipynb -k AnoPrimer -f tests/cDNA_Params_fun.json
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/github-action-AgamPrimer-gambiae.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ jobs:
poetry install
poetry run python -m ipykernel install --user --name AnoPrimer
- id: 'auth'
name: 'Set up Google Cloud authentication'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'

- name: 'Set up Google Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'

- name: 'Check gcloud CLI'
run: 'gcloud info'

- name: Run notebooks
run: |
poetry run papermill notebooks/AnoPrimer-long.ipynb qPCR_run.ipynb -k AnoPrimer -f tests/cDNA_Params.json
Expand Down
4 changes: 2 additions & 2 deletions AnoPrimer/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def prepare_gDNA_sequence(
"SEQUENCE_TEMPLATE": target_sequence,
"SEQUENCE_TARGET": target_loc_primer3,
"GENOMIC_TARGET": target,
"GENOMIC_DNA_POSITIONS": gdna_pos,
"GENOMIC_DNA_POSITIONS": list(gdna_pos),
}

if "probe" in assay_type:
Expand Down Expand Up @@ -235,7 +235,7 @@ def prepare_cDNA_sequence(
"SEQUENCE_ID": assay_name,
"SEQUENCE_TEMPLATE": target_mRNA_seq,
"GENOMIC_TARGET": transcript,
"GENOMIC_DNA_POSITIONS": gdna_pos,
"GENOMIC_DNA_POSITIONS": list(gdna_pos),
}

if cDNA_exon_junction:
Expand Down
2 changes: 1 addition & 1 deletion AnoPrimer/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(

# Extract additional attributes from seq_parameters
self.target_sequence = seq_parameters.get("SEQUENCE_TEMPLATE")
self.gdna_pos = seq_parameters.get("GENOMIC_DNA_POSITIONS")
self.gdna_pos = np.array(seq_parameters.get("GENOMIC_DNA_POSITIONS"))

def evaluate_primers(
self,
Expand Down
6 changes: 1 addition & 5 deletions notebooks/AnoPrimer-long.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@
"import malariagen_data\n",
"import primer3\n",
"import pandas as pd\n",
"import numpy as np\n",
"\n",
"import google.auth\n",
"\n",
"credentials, project = google.auth.default()"
"import numpy as np"
]
},
{
Expand Down

0 comments on commit 8699e1d

Please sign in to comment.