Skip to content

Commit

Permalink
Added work around for mixcr splitting clonotype tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
watronfire committed Oct 9, 2019
1 parent 5b0518d commit 43db327
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ for f in os.listdir( in_dir ):

rule all:
input:
expand( os.path.join( out_dir, "analyze/{sample}.clonotypes.{chain}.txt" ), out_dir=out_dir, sample=SAMPLES, chain=["TRA", "TRB"] )
expand( os.path.join( out_dir, "clonotypes/{sample}.clonotypes.txt" ), out_dir=out_dir, sample=SAMPLES )
params:
output_file = os.path.join( out_dir, "metadata.csv" )
shell:
Expand All @@ -32,7 +32,8 @@ rule repertoire_assembly:
os.path.join( out_dir, "cleaned/{sample}_R2.fastq.gz" )
output:
os.path.join( out_dir, "analyze/{sample}.clonotypes.TRA.txt" ),
os.path.join( out_dir, "analyze/{sample}.clonotypes.TRB.txt" )
os.path.join( out_dir, "analyze/{sample}.clonotypes.TRB.txt" ),
os.path.join( out_dir, "clonotypes/{sample}.clonotypes.txt" )
run:
sample_folder = os.path.join( out_dir, "analyze", wildcards.sample )
# First build the command
Expand All @@ -50,6 +51,10 @@ rule repertoire_assembly:
)
subprocess.call( command, shell=True )

clonotype_folder = os.path.join( out_dir, "clonotypes", "{}.clonotypes.txt".format( wildcards.sample ) )
export_command = "mixcr exportClones -c TRA,TRB {}.clna {}".format( sample_folder, clonotype_folder )
subprocess.call( export_command, shell=True )

rule remove_contamination:
input:
expand( os.path.join( out_dir, "umi_collapsed/{sample}_{read}.fastq.gz" ), out_dir=out_dir, sample=SAMPLES, read=["R1", "R2"] )
Expand Down

0 comments on commit 43db327

Please sign in to comment.