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
No related merge requests found
...@@ -36,7 +36,8 @@ while (my $line = <CYTO>) { ...@@ -36,7 +36,8 @@ while (my $line = <CYTO>) {
my ($chrom,$start,$end,$band) = split(/\t/,$line); my ($chrom,$start,$end,$band) = split(/\t/,$line);
my $key = $chrom.":".$start."-".$end; my $key = $chrom.":".$start."-".$end;
$band =~ m/^(\w)(.+)/; $band =~ m/^(\w)(.+)/;
push @{$cyto{$key}}, [$1,$2]; next unless ($1 && $2);
push @{$cyto{$key}{$1}},$2;
} }
open OUT, ">$prefix\.cnvcalls.txt" or die $!; open OUT, ">$prefix\.cnvcalls.txt" or die $!;
...@@ -121,16 +122,23 @@ while (my $line = <IN>) { ...@@ -121,16 +122,23 @@ while (my $line = <IN>) {
$cn_cbio = 2 if ($cn > 4); $cn_cbio = 2 if ($cn > 4);
print BIO join("\t",$gene,$entrez{$gene},$cn_cbio),"\n"; print BIO join("\t",$gene,$entrez{$gene},$cn_cbio),"\n";
print BIO2 join("\t",$gene,$entrez{$gene},$log2),"\n"; print BIO2 join("\t",$gene,$entrez{$gene},$log2),"\n";
my @cytoband = sort {$a->[1] <=>$b->[1]} @{$cyto{$key}}; my @cytoband;
if (join("",@{$cytoband[0]}) eq join("",@{$cytoband[-1]})) { if (@{$cyto{$key}{'p'}}) {
$cband = join("",@{$cytoband[0]}); @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 { }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 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 OUT join("\t",$gene,$chr,$start,$end,$abtype,$cn,$weight),"\n";
} }
} }
close IN; close IN;
close OUT; close OUT;
close BIO; 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