Skip to content
Snippets Groups Projects
Commit 4b524cbf authored by Brandi Cantarel's avatar Brandi Cantarel
Browse files

Merge branch 'master' of git.biohpc.swmed.edu:BICF/Astrocyte/process_scripts into idt_devel

parents 02708607 23bf03b3
Branches
Tags
No related merge requests found
......@@ -36,7 +36,8 @@ while (my $line = <CYTO>) {
my ($chrom,$start,$end,$band) = split(/\t/,$line);
my $key = $chrom.":".$start."-".$end;
$band =~ m/^(\w)(.+)/;
push @{$cyto{$key}}, [$1,$2];
next unless ($1 && $2);
push @{$cyto{$key}{$1}},$2;
}
open OUT, ">$prefix\.cnvcalls.txt" or die $!;
......@@ -121,16 +122,23 @@ while (my $line = <IN>) {
$cn_cbio = 2 if ($cn > 4);
print BIO join("\t",$gene,$entrez{$gene},$cn_cbio),"\n";
print BIO2 join("\t",$gene,$entrez{$gene},$log2),"\n";
my @cytoband = sort {$a->[1] <=>$b->[1]} @{$cyto{$key}};
if (join("",@{$cytoband[0]}) eq join("",@{$cytoband[-1]})) {
$cband = join("",@{$cytoband[0]});
my @cytoband;
if (@{$cyto{$key}{'p'}}) {
@nums = sort {$b <=> $a} @{$cyto{$key}{'p'}};
push @cytoband, 'p'.$nums[0],'p'.$nums[-1];
} if (@{$cyto{$key}{'q'}}) {
@nums = sort {$a <=> $b} @{$cyto{$key}{'q'}};
push @cytoband, 'q'.$nums[0],'q'.$nums[-1];
}
if ($cytoband[0] eq $cytoband[-1]) {
$cband = $cytoband[0];
}else {
$cband = join("",@{$cytoband[0]},'-',@{$cytoband[-1]});
$cband = join("-",$cytoband[0],$cytoband[-1]);
}
print OUT2 join("\t",$gene,$chr,$start,$end,$abtype,$cn,$weight,$cband),"\n";
print OUT join("\t",$gene,$chr,$start,$end,$abtype,$cn,$weight),"\n";
}
}
print OUT2 join("\t",$gene,$chr,$start,$end,$abtype,$cn,$weight,$cband),"\n";
print OUT join("\t",$gene,$chr,$start,$end,$abtype,$cn,$weight),"\n";
}
}
close IN;
close OUT;
close BIO;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment