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

account for LOH in CNVKit

parent d671a8a5
Branches
Tags
No related merge requests found
...@@ -102,26 +102,36 @@ while (my $line = <IN>) { ...@@ -102,26 +102,36 @@ while (my $line = <IN>) {
print CNSO join("\t",$hash{chromosome},$hash{start},$hash{end}, print CNSO join("\t",$hash{chromosome},$hash{start},$hash{end},
$hash{log2},$hash{cn}),"\n"; $hash{log2},$hash{cn}),"\n";
next if ($hash{cn} == 2) || scalar(keys %genes) < 1; next if ($hash{cn} == 2 && $hash{cn1} ne '' && $hash{cn2} ne '' && $hash{cn1} > 0 && $hash{cn2} > 0) || scalar(keys %genes) < 1;
next if ($hash{cn} == 2 && $hash{cn1} eq '' && $hash{cn2} eq '');
my $abtype = 'amplification'; my $abtype = 'amplification';
$abtype = 'loss' if ($hash{cn} < 2); if ($hash{cn} != 2) {
$abtype = 'gain' if ($hash{cn} > 2 && $hash{cn} < 6); $abtype = 'loss' if ($hash{cn} < 2);
foreach $gene (keys %genes) { if ($hash{cn} > 2 && $hash{cn} < 6) {
my @cytoband; $abtype = 'gain' ;
if ($cyto{$key}{'p'}) { if ($hash{cn1} ne '' && $hash{cn2} ne '' && ($hash{cn1} == 0 || $hash{cn2} == 0)) {
@nums = sort {$b <=> $a} @{$cyto{$key}{'p'}}; $abtype.= ' LOH';
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]);
} }
print OUT join("\t",$gene,$hash{chromosome},$hash{start},$hash{end}, }
$abtype,$hash{cn},$hash{weight},$cband),"\n"; }else {
$abtype = 'cnLOH';
} }
} foreach $gene (keys %genes) {
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]);
}
print OUT join("\t",$gene,$hash{chromosome},$hash{start},$hash{end},
$abtype,$hash{cn},$hash{weight},$cband),"\n";
}
}
close IN; close IN;
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