Skip to content
Snippets Groups Projects
Commit c06b562c authored by mariabernard's avatar mariabernard
Browse files

1000RNASEQ chicken ASE: add bai inputs, correct phaser.py commande line

parent 1ce61910
No related branches found
No related tags found
No related merge requests found
...@@ -22,11 +22,25 @@ def get_splitNCigar_bam(wildcards): ...@@ -22,11 +22,25 @@ def get_splitNCigar_bam(wildcards):
else : else :
raise Exception(wildcards.sample + " is sequenced in pair end & single end mode\n This workflow do not accept this case!\n") raise Exception(wildcards.sample + " is sequenced in pair end & single end mode\n This workflow do not accept this case!\n")
def get_splitNCigar_bai(wildcards):
sample_table = table[table["sample_name"] == wildcards.sample]
# paired end, filter on properly paired and rmdup
if len(sample_table["forward_read"]) == len(sample_table["reverse_read"].dropna()) :
return "Results/STAR_Aln_2/" + wildcards.sample + "_rg_genomic_pp_rmdup_uniq_split.bai"
# single end, no filter
elif len(sample_table["reverse_read"].dropna() ) == 0:
return "Results/STAR_Aln_2/" + wildcards.sample + "_rg_genomic_rmdup_uniq_split.bai"
else :
raise Exception(wildcards.sample + " is sequenced in pair end & single end mode\n This workflow do not accept this case!\n")
rule ASEReadCounter: rule ASEReadCounter:
input: input:
ref = config["fasta_ref"], ref = config["fasta_ref"],
vcf = 'Results/hard_filtering/' + os.path.basename(config['vcf']).replace('.vcf.gz','') + '_SNP_filtered.vcf.gz', vcf = 'Results/hard_filtering/' + os.path.basename(config['vcf']).replace('.vcf.gz','') + '_SNP_filtered.vcf.gz',
bam = get_splitNCigar_bam bam = get_splitNCigar_bam ,
bai = get_splitNCigar_bai
output: output:
cvs = 'Results/Counter/{sample}_ASEReadCounter.csv' cvs = 'Results/Counter/{sample}_ASEReadCounter.csv'
log: log:
...@@ -44,7 +58,8 @@ rule ASEReadCounter: ...@@ -44,7 +58,8 @@ rule ASEReadCounter:
rule phASER: rule phASER:
input: input:
vcf = 'Results/hard_filtering/' + os.path.basename(config['vcf']).replace('.vcf.gz','') + '_SNP_filtered.vcf.gz', vcf = 'Results/hard_filtering/' + os.path.basename(config['vcf']).replace('.vcf.gz','') + '_SNP_filtered.vcf.gz',
bam = get_splitNCigar_bam bam = get_splitNCigar_bam,
bai = get_splitNCigar_bai
output: output:
cvs = 'Results/Counter/{sample}_phASER.csv' cvs = 'Results/Counter/{sample}_phASER.csv'
log: log:
...@@ -55,5 +70,5 @@ rule phASER: ...@@ -55,5 +70,5 @@ rule phASER:
paired_option = lambda wildcards : '1' if len(table[table['sample_name'] == wildcards.sample]['forward_read']) == len(table[table['sample_name'] == wildcards.sample]['reverse_read'].dropna()) else '0' paired_option = lambda wildcards : '1' if len(table[table['sample_name'] == wildcards.sample]['forward_read']) == len(table[table['sample_name'] == wildcards.sample]['reverse_read'].dropna()) else '0'
shell: shell:
""" """
python2.7 phaser.py --vcf {input.vcf} --bam {input.bam} --sample {wildcards.sample} --threads {threads} --o Results/Counter/{wildcards.sample}_phASER --paired_end {params.paired_option} --baseq {params.baseQuality} --mapq {params.mappingQuality} python2.7 {config[bin_dir]}/phaser.py --vcf {input.vcf} --bam {input.bam} --sample {wildcards.sample} --threads {threads} --o Results/Counter/{wildcards.sample}_phASER --paired_end {params.paired_option} --baseq {params.baseQuality} --mapq {params.mappingQuality}
""" """
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment