-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! Format Python code with psf/black pull_request
- Loading branch information
PMBio
authored and
PMBio
committed
Feb 20, 2024
1 parent
a4b98c5
commit 152d9cd
Showing
5 changed files
with
34 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2436,4 +2436,4 @@ def select_rename_fill_annotations( | |
|
||
|
||
if __name__ == "__main__": | ||
cli() | ||
cli() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from absplice import SplicingOutlierResult | ||
|
||
splicing_result = SplicingOutlierResult( | ||
df_mmsplice=snakemake.input['mmsplice_splicemap'], | ||
df_spliceai=snakemake.input['spliceai'], | ||
) | ||
splicing_result.predict_absplice_dna(extra_info=snakemake.params['extra_info']) | ||
splicing_result._absplice_dna.to_csv(snakemake.output['absplice_dna']) | ||
df_mmsplice=snakemake.input["mmsplice_splicemap"], | ||
df_spliceai=snakemake.input["spliceai"], | ||
) | ||
splicing_result.predict_absplice_dna(extra_info=snakemake.params["extra_info"]) | ||
splicing_result._absplice_dna.to_csv(snakemake.output["absplice_dna"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
import pandas as pd | ||
import pyranges as pr | ||
|
||
gr = pr.read_gtf(snakemake.input['gtf_file']) | ||
gr = gr[(gr.Feature == 'gene') & (gr.gene_type == 'protein_coding')] | ||
gr = pr.read_gtf(snakemake.input["gtf_file"]) | ||
gr = gr[(gr.Feature == "gene") & (gr.gene_type == "protein_coding")] | ||
df_genes = gr.df | ||
|
||
df_genes['gene_id_orig'] = df_genes['gene_id'] | ||
df_genes['PAR_Y'] = df_genes['gene_id'].apply(lambda x: 'PAR_Y' in x) | ||
df_genes = df_genes[df_genes['PAR_Y'] == False] | ||
df_genes['gene_id'] = df_genes['gene_id'].apply(lambda x: x.split('.')[0]) | ||
df_genes["gene_id_orig"] = df_genes["gene_id"] | ||
df_genes["PAR_Y"] = df_genes["gene_id"].apply(lambda x: "PAR_Y" in x) | ||
df_genes = df_genes[df_genes["PAR_Y"] == False] | ||
df_genes["gene_id"] = df_genes["gene_id"].apply(lambda x: x.split(".")[0]) | ||
|
||
columns = [ | ||
'Chromosome', 'Start', 'End', 'Strand', | ||
'gene_id', 'gene_id_orig', 'gene_name', 'gene_type' | ||
"Chromosome", | ||
"Start", | ||
"End", | ||
"Strand", | ||
"gene_id", | ||
"gene_id_orig", | ||
"gene_name", | ||
"gene_type", | ||
] | ||
df_genes[columns].to_csv(snakemake.output['coding_genes'], index=False) | ||
df_genes[columns].to_csv(snakemake.output["coding_genes"], index=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
from absplice import SpliceOutlier, SpliceOutlierDataloader | ||
|
||
dl = SpliceOutlierDataloader( | ||
snakemake.input['fasta'], snakemake.input['vcf'], | ||
splicemap5=list(snakemake.input['splicemap_5']), | ||
splicemap3=list(snakemake.input['splicemap_3']) | ||
snakemake.input["fasta"], | ||
snakemake.input["vcf"], | ||
splicemap5=list(snakemake.input["splicemap_5"]), | ||
splicemap3=list(snakemake.input["splicemap_3"]), | ||
) | ||
|
||
model = SpliceOutlier() | ||
model.predict_save(dl, snakemake.output['result']) | ||
model.predict_save(dl, snakemake.output["result"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
from spliceai_rocksdb.spliceAI import SpliceAI | ||
|
||
|
||
if snakemake.params['lookup_only']: | ||
model = SpliceAI(db_path=snakemake.params['db_path']) | ||
if snakemake.params["lookup_only"]: | ||
model = SpliceAI(db_path=snakemake.params["db_path"]) | ||
else: | ||
model = SpliceAI(snakemake.input['fasta'], | ||
annotation=snakemake.params['genome'], | ||
db_path=snakemake.params['db_path']) | ||
model = SpliceAI( | ||
snakemake.input["fasta"], | ||
annotation=snakemake.params["genome"], | ||
db_path=snakemake.params["db_path"], | ||
) | ||
|
||
|
||
model.predict_save(snakemake.input['vcf'], | ||
snakemake.output['result']) | ||
model.predict_save(snakemake.input["vcf"], snakemake.output["result"]) |