Skip to content

Commit 9b4a3ed

Browse files
committed
Treeomics
1 parent 97cbfb0 commit 9b4a3ed

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

result/sims/treeomics/convert_reads_to_treeomics.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ def write_reads(f, reads, nrMutations, loci):
4747
f.write("\t".join(["Chromosome", "Position", "Change", "Gene"] + samples) + "\n")
4848
f.write("\t".join(["#Purity", ".", ".", "."] + ["1.0"] * nrSamples) + "\n")
4949
for i in range(nrMutations):
50-
f.write("\t".join(map(str, list(loci[i])) + [str(r[1][i]) for r in reads]) + "\n")
50+
s = map(str, list(loci[i])) + [str(r[1][i]) for r in reads]
51+
s[3] = 'mut' + str(i)
52+
f.write("\t".join(s) + "\n")
5153

5254
if __name__ == "__main__":
5355
if len(sys.argv) != 3:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
for p in {mS,S,M,R}
3+
do
4+
for f in ../../../../data/sims/$p/reads_seed*.tsv
5+
do
6+
s=$(basename $f .tsv | sed -e s/reads_seed//g)
7+
echo Generating TreeOmics slurm file for seed $s pattern $p...
8+
9+
f="${p}_${s}.slurm"
10+
echo "#!/bin/bash" > $f
11+
echo "#SBATCH --job-name=\"${p}_${s}_treeomics\"" >> $f
12+
echo "#SBATCH -c 16" >> $f
13+
echo "#SBATCH -t 1:30:00" >> $f
14+
echo "#SBATCH --mem=100G" >> $f
15+
echo "cd /n/fs/ragr-data/projects/MACHINA/treeomics/src" >> $f
16+
echo "source activate treeomics_env" >> $f
17+
echo "python treeomics -r ../../machina/result/sims/treeomics/${p}_seed${s}_variant.txt -s ../../machina/result/sims/treeomics/${p}_seed${s}_coverage.txt -o output/${p}_seed${s} -l 100 -t 3600 " >> $f
18+
19+
ff="${p}_${s}_SUBCLONES.slurm"
20+
echo "#!/bin/bash" > $ff
21+
echo "#SBATCH --job-name=\"${p}_${s}_treeomics_SUBCLONES\"" >> $ff
22+
echo "#SBATCH -c 16" >> $ff
23+
echo "#SBATCH -t 1:30:00" >> $ff
24+
echo "#SBATCH --mem=100G" >> $ff
25+
echo "cd /n/fs/ragr-data/projects/MACHINA/treeomics/src" >> $ff
26+
echo "source activate treeomics_env" >> $ff
27+
echo "python treeomics -r ../../machina/result/sims/treeomics/${p}_seed${s}_variant.txt -s ../../machina/result/sims/treeomics/${p}_seed${s}_coverage.txt -o output/${p}_seed${s}_SUBCLONES -l 100 -u -t 3600" >> $ff
28+
done
29+
done

0 commit comments

Comments
 (0)