Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

CNV consensus (8 of 6): Changing Step3 to use Bedtools Subtract #430

Merged
merged 13 commits into from
Jan 14, 2020
6 changes: 3 additions & 3 deletions analyses/copy_number_consensus_call/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,15 @@ rule manta_filter:
rule filter_telomeres:
input:
## Define the location of the input file and take the path/extension from the config file
script=os.path.join(config["scripts"], "get_rid_bad_segments.py"),
bad_list=os.path.join(config["scripts"], "bad_chromosomal_seg_updated_merged.bed"),
bedfile="../../scratch/interim/{sample}.{caller}.{dupdel}.bed"
output:
## Define the output files' names
filtered_bed="../../scratch/interim/{sample}.{caller}.{dupdel}.filtered.bed"
threads: 1
shell:
## Invoke the python3 script and pass in the reference and CNVs files. Direct the stdout to a new file.
"python3 {input.script} --reference {input.bad_list} --file {input.bedfile} > {output.filtered_bed}"
## Invoke the bedtools subtract pass in the reference and CNVs files. Direct the stdout to a new file.
"bedtools subtract -N -a {input.bedfile} -b {input.bad_list} -f 0.5 > {output.filtered_bed}"


rule first_merge:
Expand Down Expand Up @@ -204,3 +203,4 @@ rule clean_output:
"results/cnv_consensus.tsv"
shell:
"python3 {input.script} --file {input.cnv_file} > {output}"

Original file line number Diff line number Diff line change
Expand Up @@ -3167,7 +3167,7 @@ chr3 84952630 87955725 NULL 84950794:86911163:3,86911164:88297478:3 84952630:861
chr3 93649137 162808158 NULL 93649137:144671157:3,144671158:148925621:3,148925622:162808158:3 93512945:94627725:3,94627725:94631200:3,94631200:94770200:3,94770895:96420825:3,96421520:96702995:3,96702995:96706470:3,96706470:98244505:3,98244505:98249370:3,98249370:99072250:3,99072250:99227235:3,99227235:99343995:3,99343995:99347470:3,99347470:100430280:3,100430280:100435145:3,100435145:100795850:3,100795850:100827820:3,100827820:102084380:3,102085075:102991355:3,102991355:103832305:3,103833000:103955320:3,103955320:103981730:3,103981730:104394560:3,104395950:104569005:3,104569005:105774830:3,105775525:106378090:3,106378785:108032885:3,108034970:108318530:3,108319225:109156005:3,109156005:109263730:3,109266510:110058810:3,110058810:110062980:3,110062980:110371560:3,110371560:110794815:3,110796900:111147875:3,111147875:111152740:3,111152740:111361240:3,111361240:111872760:3,111872760:112468375:3,112471155:112716490:3,112717880:114292055:3,114292055:115048910:3,115048910:115053775:3,115053775:116300605:3,116301995:116589030:3,116589725:118575340:3,118575340:118686540:3,118689320:119395440:3,119395440:119533745:3,119535135:120095305:3,120095305:120916795:3,120917490:121556195:3,121556195:121561060:3,121561060:123653705:3,123653705:123659265:3,123659265:124059585:3,124061670:124968645:3,124968645:125040230:3,125040925:125204250:3,125204250:125414835:3,125414835:125418310:3,125418310:125664340:3,125871450:126530310:3,126530310:126677650:3,126677650:126696415:3,126696415:126969550:3,126970245:127350410:3,127350410:129039260:3,129041345:129350620:3,129357570:129583445:3,129584140:130044925:3,130079675:130387560:3,130388950:134391455:3,134391455:134415085:3,134415085:135905165:3,135905165:136818395:3,136818395:136947665:3,136947665:136952530:3,136952530:137153385:3,137153385:137185355:3,137185355:137791395:3,137792090:138124995:3,138125690:138409945:3,138411335:139671370:3,139672065:139769365:3,139769365:141656290:3,141656290:142283875:3,142283875:142694620:3,142694620:142698790:3,142698790:144671895:3,144671895:145747755:3,145750535:146042435:3,146042435:146230780:3,146232170:146367695:3,146367695:148630615:3,148630615:148637565:3,148638260:148773090:3,148773090:153836165:3,153836860:154109995:3,154116945:156622420:3,156622420:157090155:3,157092935:158107635:3,158108330:158594830:3,158594830:159205040:3,159205040:159214075:3,159214075:159437865:3,159437865:159444815:3,159444815:162351305:3,162352000:162447910:3,162447910:162512545:3,162512545:164365415:3,164365415:164475920:3,164477310:164801875:3,164803265:165132695:3,165132695:166291955:3,166294735:166587330:3,166587330:166592890:3,166592890:167084255:3,167084255:167358085:3,167359475:171863770:3,171863770:171867245:3 DUP BS_WY5KYSHJ
chr3 171969410 195966153 NULL 162827473:195616354:3,195616355:195730092:5,195730093:195966153:3 171969410:172147330:3,172252970:172281465:3,172281465:173296860:3,173297555:173729150:3,173729150:175556305:3,175557695:175720325:3,175723105:176335400:3,176344435:184803280:3,184805365:185514960:3,185514960:186474060:3,186474755:186773605:3,186773605:188897525:3,188903085:189042780:3,189043475:189265180:3,189270045:189441710:3,189442405:190349380:3,190352160:190477260:3,190477260:190483515:3,190483515:191922165:3,191922860:192849295:3,192850685:193417110:3,193418500:194543705:3,194544400:195148355:3,195151135:195247045:3,195247045:196596040:3,196596735:198156315:3 DUP BS_WY5KYSHJ
chr1 18423247 18601943 18422714:18428084:NA,18427821:18601943:NA 18423247:18602345:3 NULL DUP BS_X1DSETVE
chr1 149743647 207527447 147699786:224374617:NA,151192918:224378395:NA,154279508:156053291:NA,154283619:156050650:NA,154283619:156053365:NA,156051660:156078863:NA,186958658:189414983:NA,223721204:223740662:NA 149743647:151178440:3,151178441:151392366:3,151392367:152147573:3,152147574:152217223:3,152217224:152351549:3,152351550:152361499:3,152361500:153302771:3,154767417:155000246:3,155079848:155216162:3,155662919:169254659:3,169277545:206163298:3,206409065:207527447:3 NULL DUP BS_X1DSETVE
chr1 149743647 207527447 147699786:224374617:NA,151192918:224378395:NA,154279508:156053291:NA,154283619:156053365:NA,154283619:156050650:NA,156051660:156078863:NA,186958658:189414983:NA,223721204:223740662:NA 149743647:151178440:3,151178441:151392366:3,151392367:152147573:3,152147574:152217223:3,152217224:152351549:3,152351550:152361499:3,152361500:153302771:3,154767417:155000246:3,155079848:155216162:3,155662919:169254659:3,169277545:206163298:3,206409065:207527447:3 NULL DUP BS_X1DSETVE
chr2 162345760 162382530 162345760:162382854:NA 162345716:162382530:3 NULL DUP BS_X1DSETVE
chr20 15789213 15802607 15789213:15803019:NA 15788678:15802607:3 NULL DUP BS_X1DSETVE
chr20 38794600 38805566 38794600:38805943:NA 38791637:38805566:3 NULL DUP BS_X1DSETVE
Expand Down

This file was deleted.