diff --git a/deeprvat/annotations/annotations.py b/deeprvat/annotations/annotations.py index 8630b8e6..ae922697 100644 --- a/deeprvat/annotations/annotations.py +++ b/deeprvat/annotations/annotations.py @@ -2436,4 +2436,4 @@ def select_rename_fill_annotations( if __name__ == "__main__": - cli() \ No newline at end of file + cli() diff --git a/pipelines/resources/absplice_dna.py b/pipelines/resources/absplice_dna.py index afeea3b6..348eea49 100644 --- a/pipelines/resources/absplice_dna.py +++ b/pipelines/resources/absplice_dna.py @@ -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']) \ No newline at end of file + 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"]) diff --git a/pipelines/resources/coding_genes.py b/pipelines/resources/coding_genes.py index 8c2b7774..a98a6068 100644 --- a/pipelines/resources/coding_genes.py +++ b/pipelines/resources/coding_genes.py @@ -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) \ No newline at end of file +df_genes[columns].to_csv(snakemake.output["coding_genes"], index=False) diff --git a/pipelines/resources/mmsplice_splicemap.py b/pipelines/resources/mmsplice_splicemap.py index 6cd832d8..5d193d87 100644 --- a/pipelines/resources/mmsplice_splicemap.py +++ b/pipelines/resources/mmsplice_splicemap.py @@ -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']) \ No newline at end of file +model.predict_save(dl, snakemake.output["result"]) diff --git a/pipelines/resources/spliceai.py b/pipelines/resources/spliceai.py index d81f12f1..71ab5ff5 100644 --- a/pipelines/resources/spliceai.py +++ b/pipelines/resources/spliceai.py @@ -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"])