Skip to content

Instantly share code, notes, and snippets.

@epaule
Created February 11, 2011 10:31
Show Gist options
  • Save epaule/822186 to your computer and use it in GitHub Desktop.
Save epaule/822186 to your computer and use it in GitHub Desktop.
flip EST orientation
my $cDNA_span = shift;
my $chrom = shift;
my %est_orient;
$wormbase->FetchData("estorientation",\%est_orient) unless (5 < scalar keys %est_orient);
foreach my $EST ( keys %est_orient ) {
if ( exists $$cDNA_span{$EST} && defined $$cDNA_span{$EST}->[2]) {
my $GFF_strand = $$cDNA_span{$EST}->[2];
my $read_dir = $est_orient{$EST};
CASE:{
($GFF_strand eq "+" and $read_dir eq "5") && do {
$$cDNA_span{$EST}->[2] = "+";
last CASE;
};
($GFF_strand eq "+" and $read_dir eq "3") && do {
$$cDNA_span{$EST}->[2] = "-";
last CASE;
};
($GFF_strand eq "-" and $read_dir eq "5") && do {
$$cDNA_span{$EST}->[2] = "-";
last CASE;
};
($GFF_strand eq "-" and $read_dir eq "3") && do {
$$cDNA_span{$EST}->[2] = "+";
last CASE;
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment