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

Commit

Permalink
gerge branch 'activeDev' of https://github.com/CCBR/Pipeliner into ac…
Browse files Browse the repository at this point in the history
…tiveDev
  • Loading branch information
tovahmarkowitz committed Jan 17, 2019
2 parents abb6466 + 00d2f3c commit 6de4005
Show file tree
Hide file tree
Showing 34 changed files with 810 additions and 424 deletions.
50 changes: 50 additions & 0 deletions Results-template/Scripts/make_freec_pass1_exome_tn_config.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/perl -w
use strict;
use List::Util 'shuffle';

#INPUT

#my $mergedmaf = $ARGV[1] . '_out/oncotator_out/' . $ARGV[1] . '_merged.maf'; #to fix...
#open C, ">$mergedmaf";

my $outfile = $ARGV[0] . '/freec_exome_config.txt';
my $chrLenFile = $ARGV[1];
my $chrFiles = $ARGV[2];
my $tumormateFile = $ARGV[3];
my $controlmateFile = $ARGV[4];
my $makePileup = $ARGV[5];
my $fastaFile = $ARGV[6];
my $SNPfile = $ARGV[7];
my $targets = $ARGV[8];

open C, ">$outfile";

print C '[general]' . "\n\n";

print C "BedGraphOutput = TRUE\ndegree = 1\nforceGCcontentNormalization = 1\nminCNAlength = 3\nnoisyData = TRUE\nreadCountThreshold = 50\n";
print C "chrLenFile = $chrLenFile\n";
print C "ploidy = 2,3,4,5\nbreakPointThreshold = 0.8\nwindow = 0\n";
print C "chrFiles = $chrFiles\n";
print C "minimalSubclonePresence = 30\nprintNA = FALSE\ncontaminationAdjustment = TRUE\nmaxThreads = 24\nnumberOfProcesses = 24\n";
print C "outputDir = $ARGV[0]\n\n";

print C '[sample]' . "\n\n";

print C "mateFile = $tumormateFile\n";
print C "inputFormat = BAM\nmateOrientation = FR\n\n";

print C '[control]' . "\n\n";

print C "mateFile = $controlmateFile\n";
print C "inputFormat = BAM\nmateOrientation = FR\n\n";

print C '[target]' . "\n\n";

print C "captureRegions = $targets\n\n";

print C '[BAF]' . "\n\n";

print C "makePileup = $makePileup\n";
print C "fastaFile = $fastaFile\n";
print C "minimalCoveragePerPosition = 20\nminimalQualityPerPosition = 20\n";
print C "SNPfile = $SNPfile";
46 changes: 46 additions & 0 deletions Results-template/Scripts/make_freec_pass1_wgs_tn_config.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/perl -w
use strict;
use List::Util 'shuffle';

#INPUT

#my $mergedmaf = $ARGV[1] . '_out/oncotator_out/' . $ARGV[1] . '_merged.maf'; #to fix...
#open C, ">$mergedmaf";

my $outfile = $ARGV[0] . '/freec_wgs_config.txt';
my $chrLenFile = $ARGV[1];
my $chrFiles = $ARGV[2];
my $tumormateFile = $ARGV[3];
my $controlmateFile = $ARGV[4];
my $makePileup = $ARGV[5];
my $fastaFile = $ARGV[6];
my $SNPfile = $ARGV[7];

open C, ">$outfile";

print C '[general]' . "\n\n";

print C "chrLenFile = $chrLenFile\n";
print C "ploidy = 2,3,4,5,6\nbreakPointThreshold = 0.8\nwindow = 1000\n";
print C "chrFiles = $chrFiles\n";
print C "minimalSubclonePresence = 20\ncontaminationAdjustment = TRUE\nmaxThreads = 24\nnumberOfProcesses = 24\n";
print C "outputDir = $ARGV[0]\n\n";

print C '[sample]' . "\n\n";

print C "mateFile = $tumormateFile\n";
print C "inputFormat = BAM\nmateOrientation = FR\n\n";

print C '[control]' . "\n\n";

print C "mateFile = $controlmateFile\n";
print C "inputFormat = BAM\nmateOrientation = FR\n\n";

print C '[target]' . "\n\n";

print C '[BAF]' . "\n\n";

print C "makePileup = $makePileup\n";
print C "fastaFile = $fastaFile\n";
print C "minimalCoveragePerPosition = 20\nminimalQualityPerPosition = 20\n";
print C "SNPfile = $SNPfile";
68 changes: 68 additions & 0 deletions Results-template/Scripts/make_freec_pass2_exome_tn_config.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/perl -w
use strict;
use List::Util 'shuffle';

#INPUT

#my $mergedmaf = $ARGV[1] . '_out/oncotator_out/' . $ARGV[1] . '_merged.maf'; #to fix...
#open C, ">$mergedmaf";

my $outfile = $ARGV[0] . '/freec_exome_config.txt';
my $chrLenFile = $ARGV[1];
my $chrFiles = $ARGV[2];
my $tumormateFile = $ARGV[3];
my $controlmateFile = $ARGV[4];
my $makePileup = $ARGV[5];
my $fastaFile = $ARGV[6];
my $SNPfile = $ARGV[7];
my $targets = $ARGV[8];
my @line=();
my $contamination='';
my $ploidy='';
my $rep=0;

my $infile=$ARGV[9];
open G, "<$infile";
while (<G>){
chomp;
last if m/^$/;
@line = split;
next if ($line[0] =~ m'cellularity');
if ($rep==0) {
$contamination=(1-$line[0]);
$ploidy=$line[1];
$rep++;
}
}

open C, ">$outfile";

print C '[general]' . "\n\n";

print C "BedGraphOutput = TRUE\ndegree = 1\nforceGCcontentNormalization = 1\nminCNAlength = 3\nnoisyData = TRUE\nreadCountThreshold = 50\n";
print C "chrLenFile = $chrLenFile\n";
print C "ploidy = $ploidy\ncontamination=$contamination\nbreakPointThreshold = 0.8\nwindow = 0\n";
print C "chrFiles = $chrFiles\n";
print C "minimalSubclonePresence = 30\nprintNA = FALSE\ncontaminationAdjustment = TRUE\nmaxThreads = 24\nnumberOfProcesses = 24\n";
print C "outputDir = $ARGV[0]\n\n";

print C '[sample]' . "\n\n";

print C "mateFile = $tumormateFile\n";
print C "inputFormat = BAM\nmateOrientation = FR\n\n";

print C '[control]' . "\n\n";

print C "mateFile = $controlmateFile\n";
print C "inputFormat = BAM\nmateOrientation = FR\n\n";

print C '[target]' . "\n\n";

print C "captureRegions = $targets\n\n";

print C '[BAF]' . "\n\n";

print C "makePileup = $makePileup\n";
print C "fastaFile = $fastaFile\n";
print C "minimalCoveragePerPosition = 20\nminimalQualityPerPosition = 20\n";
print C "SNPfile = $SNPfile";
64 changes: 64 additions & 0 deletions Results-template/Scripts/make_freec_pass2_wgs_tn_config.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/perl -w
use strict;
use List::Util 'shuffle';

#INPUT

#my $mergedmaf = $ARGV[1] . '_out/oncotator_out/' . $ARGV[1] . '_merged.maf'; #to fix...
#open C, ">$mergedmaf";

my $outfile = $ARGV[0] . '/freec_wgs_config.txt';
my $chrLenFile = $ARGV[1];
my $chrFiles = $ARGV[2];
my $tumormateFile = $ARGV[3];
my $controlmateFile = $ARGV[4];
my $makePileup = $ARGV[5];
my $fastaFile = $ARGV[6];
my $SNPfile = $ARGV[7];
my @line=();
my $contamination='';
my $ploidy='';
my $rep=0;

my $infile=$ARGV[8];
open G, "<$infile";
while (<G>){
chomp;
last if m/^$/;
@line = split;
next if ($line[0] =~ m'cellularity');
if ($rep==0) {
$contamination=(1-$line[0]);
$ploidy=$line[1];
$rep++;
}
}

open C, ">$outfile";

print C '[general]' . "\n\n";

print C "chrLenFile = $chrLenFile\n";
print C "ploidy = 2,3,4,5,6\nbreakPointThreshold = 0.8\nwindow = 1000\n";
print C "chrFiles = $chrFiles\n";
print C "minimalSubclonePresence = 20\ncontaminationAdjustment = TRUE\nmaxThreads = 24\nnumberOfProcesses = 24\n";
print C "outputDir = $ARGV[0]\n\n";

print C '[sample]' . "\n\n";

print C "mateFile = $tumormateFile\n";
print C "inputFormat = BAM\nmateOrientation = FR\n\n";

print C '[control]' . "\n\n";

print C "mateFile = $controlmateFile\n";
print C "inputFormat = BAM\nmateOrientation = FR\n\n";

print C '[target]' . "\n\n";

print C '[BAF]' . "\n\n";

print C "makePileup = $makePileup\n";
print C "fastaFile = $fastaFile\n";
print C "minimalCoveragePerPosition = 20\nminimalQualityPerPosition = 20\n";
print C "SNPfile = $SNPfile";
62 changes: 62 additions & 0 deletions Results-template/Scripts/make_freec_wgs_tumoronly_config.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/perl -w
use strict;
use List::Util 'shuffle';

#INPUT

#my $mergedmaf = $ARGV[1] . '_out/oncotator_out/' . $ARGV[1] . '_merged.maf'; #to fix...
#open C, ">$mergedmaf";

my $canvasfile=$ARGV[7];
my $outfile = $ARGV[0] . '/freec_wgs_config.txt';
my $chrLenFile = $ARGV[1];
my $chrFiles = $ARGV[2];
my $tumormateFile = $ARGV[3];
my $makePileup = $ARGV[4];
my $fastaFile = $ARGV[5];
my $SNPfile = $ARGV[6];

my $cmd='';
my $contamination=''
my $ploidy=''

$cmd='zgrep EstimatedTumorPurity ' . $canvasfile . ' >> purity_ploidy_prior.txt; zgrep OverallPloidy ' . $canvasfile . ' >> ' . $ARGV[0] . '/purity_ploidy_prior.txt';
system($cmd);

my $infile=$ARGV[0] . '/purity_ploidy_prior.txt';
open G, "<$infile";
while (<G>){
chomp;
last if m/^$/;
@line = split '=', $_;
if ($line[0] =~ m'Purity') {
$contamination=(1-$line[1]);
}
if ($line[0] =~ m'Ploidy') {
$ploidy=$line[1];
}
}

open C, ">$outfile";

print C '[general]' . "\n\n";

print C "chrLenFile = $chrLenFile\n";
print C "ploidy = $ploidy\ncontamination = $contamination\nbreakPointThreshold = 0.8\nwindow = 1000\n";
print C "chrFiles = $chrFiles\n";
print C "minimalSubclonePresence = 20\ncontaminationAdjustment = TRUE\nmaxThreads = 24\nnumberOfProcesses = 24\n";
print C "outputDir = $ARGV[0]\n\n";

print C '[sample]' . "\n\n";

print C "mateFile = $tumormateFile\n";
print C "inputFormat = BAM\nmateOrientation = FR\n\n";

print C '[target]' . "\n\n";

print C '[BAF]' . "\n\n";

print C "makePileup = $makePileup\n";
print C "fastaFile = $fastaFile\n";
print C "minimalCoveragePerPosition = 20\nminimalQualityPerPosition = 20\n";
print C "SNPfile = $SNPfile";
45 changes: 3 additions & 42 deletions Results-template/Scripts/prep_mafs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -39,38 +39,10 @@
}
}
elsif ($line[0] !~ m'#') {
if ($line[44] ne '-') {
if ($line[44] < 2) {
if (($line[41] > 2) && ($line[39] > 9)) {
if ($line[123] ne '-') {
if ($line[123] < 0.001) {
print C "$_\t";
if ($line[39] != 0){
$calc=($line[41]/$line[39]);
print C "$calc\n";
}
else {
print "0\n";
}
}
}
else {
print C "$_\t";
if ($line[39] != 0){
$calc=($line[41]/$line[39]);
print C "$calc\n";
}
else {
print "0\n";
}
}
}
}
}
else {
next if ($line[0] =~ /TTN|MUC16|OBSCN|AHNAK2|SYNE1|FLG|MUC5B|DNAH17|PLEC|DST|SYNE2|NEB|HSPG2|LAMA5|AHNAK|HMCN1|USH2A|DNAH11|MACF1|MUC17|DNAH5|GPR98|FAT1|PKD1|MDN1|RNF213|RYR1|DNAH2|DNAH3|DNAH8|DNAH1|DNAH9|ABCA13|SRRM2|CUBN|SPTBN5|PKHD1|LRP2|FBN3|CDH23|DNAH10|FAT4|RYR3|PKHD1L1|FAT2|CSMD1|PCNT|COL6A3|FRAS1|FCGBP|RYR2|HYDIN|XIRP2|LAMA1/);
if (($line[44] eq '-') || ($line[44] < 2)) {
if (($line[41] > 2) && ($line[39] > 9)) {
if ($line[123] ne '-') {
if ($line[123] < 0.001) {
if ((($line[123] eq '-') || ($line[123] < 0.001)) && (($line[76] eq '-') || ($line[76] < 0.01)) && (($line[99] eq '-') || ($line[99] < 0.001))) {
print C "$_\t";
if ($line[39] != 0){
$calc=($line[41]/$line[39]);
Expand All @@ -81,17 +53,6 @@
}
}
}
else {
print C "$_\t";
if ($line[39] != 0){
$calc=($line[41]/$line[39]);
print C "$calc\n";
}
else {
print "0\n";
}
}
}
}
}
}
13 changes: 10 additions & 3 deletions Results-template/Scripts/reformat_bed.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
my $notrimSAM = '';
my $trimSAM= '';

my $outfile = 'exome_targets.bed'; #to fix...
my $outfile = 'exome_targets.bed';
my $freecout = 'freec_targets.bed';
open C, ">$outfile";
#print C "Chromosome\tRead_1_Start\tRead_2_Start\tHighCounts\tLowCounts\tHomozygous_informative\tHeterozygous_informative\tComps\tHighProp\tLowProp\tWinner\n";
open D, ">$freecout";

my $infile = $ARGV[0]; #to fix...
my $infile = $ARGV[0];
my @line = ();

open U, "<$infile";
Expand All @@ -22,5 +23,11 @@
if ($line[0] ne '#'){
# $chrom = ((split /hr/, $line[0])[1]);
print C "$line[0]\t$line[1]\t$line[2]\t$line[3]\t0\t.\n";
if ($ARGV[1] eq 'hg19') {
print D "chr" . "$line[0]\t$line[1]\t$line[2]\n";
}
else {
print D "$line[0]\t$line[1]\t$line[2]\n";
}
}
}
Loading

0 comments on commit 6de4005

Please sign in to comment.