Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Nextclade v3 #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phylogenetic/defaults/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ filter:
II: "--exclude-where country=India country=Bangladesh country=Thailand"
all: ""

nextalign:
nextclade:
reference_fasta: "defaults/reference.fasta"
genemap: "defaults/genemap.gff"

Expand Down
13 changes: 6 additions & 7 deletions phylogenetic/defaults/genemap.gff
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
##sequence-region NC_002728.1 1 18246
##species https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=3052225
NC_002728.1 RefSeq region 1 18246 . + . ID=NC_002728.1:1..18246;Dbxref=taxon:3052225;gbkey=Src;genome=genomic;mol_type=genomic RNA;old-name=Nipah virus
NC_002728.1 RefSeq gene 113 1711 . + 0 ID=cds-NP_112021.1;Parent=gene-Nvgp1;Dbxref=GenBank:NP_112021.1,GeneID:920951;Name=NP_112021.1;gbkey=CDS;gene=N;locus_tag=Nvgp1;product=nucleocapsid protein;protein_id=NP_112021.1
NC_002728.1 RefSeq gene 2406 4535 . + 0 ID=cds-NP_112022.1;Parent=gene-Nvgp2;Dbxref=GenBank:NP_112022.1,GeneID:920952;Name=NP_112022.1;gbkey=CDS;gene=P;product=P phosphoprotein;protein_id=NP_112022.1
NC_002728.1 RefSeq gene 5108 6166 . + 0 ID=cds-NP_112025.1;Parent=gene-Nvgp3;Dbxref=GenBank:NP_112025.1,GeneID:920953;Name=NP_112025.1;gbkey=CDS;gene=M;locus_tag=Nvgp3;product=matrix protein;protein_id=NP_112025.1
NC_002728.1 RefSeq gene 6654 8294 . + 0 ID=cds-NP_112026.1;Parent=gene-Nvgp4;Dbxref=GenBank:NP_112026.1,GeneID:920954;Name=NP_112026.1;gbkey=CDS;gene=F;locus_tag=Nvgp4;product=fusion protein;protein_id=NP_112026.1
NC_002728.1 RefSeq gene 8943 10751 . + 0 ID=cds-NP_112027.1;Parent=gene-Nvgp5;Dbxref=GenBank:NP_112027.1,GeneID:920955;Name=NP_112027.1;gbkey=CDS;gene=G;locus_tag=Nvgp5;product=attachment glycoprotein;protein_id=NP_112027.1
NC_002728.1 RefSeq gene 11412 18146 . + 0 ID=cds-NP_112028.1;Parent=gene-Nvgp6;Dbxref=GenBank:NP_112028.1,GeneID:920950;Name=NP_112028.1;gbkey=CDS;gene=L;locus_tag=Nvgp6;product=polymerase;protein_id=NP_112028.1

NC_002728.1 RefSeq CDS 113 1711 . + 0 ID=cds-NP_112021.1;Dbxref=GenBank:NP_112021.1,GeneID:920951;gbkey=CDS;gene=N;locus_tag=Nvgp1;product=nucleocapsid protein;protein_id=NP_112021.1
NC_002728.1 RefSeq CDS 2406 4535 . + 0 ID=cds-NP_112022.1;Dbxref=GenBank:NP_112022.1,GeneID:920952;gbkey=CDS;gene=P;product=P phosphoprotein;protein_id=NP_112022.1
NC_002728.1 RefSeq CDS 5108 6166 . + 0 ID=cds-NP_112025.1;Dbxref=GenBank:NP_112025.1,GeneID:920953;gbkey=CDS;gene=M;locus_tag=Nvgp3;product=matrix protein;protein_id=NP_112025.1
NC_002728.1 RefSeq CDS 6654 8294 . + 0 ID=cds-NP_112026.1;Dbxref=GenBank:NP_112026.1,GeneID:920954;gbkey=CDS;gene=F;locus_tag=Nvgp4;product=fusion protein;protein_id=NP_112026.1
NC_002728.1 RefSeq CDS 8943 10751 . + 0 ID=cds-NP_112027.1;Dbxref=GenBank:NP_112027.1,GeneID:920955;gbkey=CDS;gene=G;locus_tag=Nvgp5;product=attachment glycoprotein;protein_id=NP_112027.1
NC_002728.1 RefSeq CDS 11412 18146 . + 0 ID=cds-NP_112028.1;Dbxref=GenBank:NP_112028.1,GeneID:920950;gbkey=CDS;gene=L;locus_tag=Nvgp6;product=polymerase;protein_id=NP_112028.1
24 changes: 12 additions & 12 deletions phylogenetic/rules/prepare_sequences.smk
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@ rule filter:
"""


rule nextalign_before_mask:
rule nextclade_before_mask:
input:
fasta="builds/{build}/sequences.fasta",
reference=config["nextalign"]["reference_fasta"],
genemap=config["nextalign"]["genemap"],
reference=config["nextclade"]["reference_fasta"],
genemap=config["nextclade"]["genemap"],
output:
alignment="builds/{build}/premask.fasta",
shell:
"""
nextalign run \
nextclade run \
--input-ref {input.reference} \
--input-gene-map {input.genemap} \
--input-annotation {input.genemap} \
--output-fasta {output.alignment} \
-- {input.fasta}
"""
Expand All @@ -125,22 +125,22 @@ rule mask:
"""


rule nextalign_after_mask:
rule nextclade_after_mask:
input:
fasta="builds/{build}/masked.fasta",
reference=config["nextalign"]["reference_fasta"],
genemap=config["nextalign"]["genemap"],
reference=config["nextclade"]["reference_fasta"],
genemap=config["nextclade"]["genemap"],
output:
alignment="builds/{build}/aligned.fasta",
params:
template_string=lambda w: f"builds/{w.build}/translations/gene.{{gene}}.fasta",
template_string=lambda w: f"builds/{w.build}/translations/gene.{{cds}}.fasta",
genes=",".join(genes),
shell:
"""
nextalign run \
nextclade run \
--input-ref {input.reference} \
--input-gene-map {input.genemap} \
--genes {params.genes} \
--input-annotation {input.genemap} \
--cds-selection {params.genes} \
--output-translations {params.template_string} \
--output-fasta {output.alignment} \
-- {input.fasta}
Expand Down