Skip to content

Commit

Permalink
same locus isoforms are in one merged entry
Browse files Browse the repository at this point in the history
  • Loading branch information
hoyu310 committed Jan 4, 2021
1 parent ec602cd commit a2eae56
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions psirc_v1.0.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2086,12 +2086,14 @@ sub merge_full_length_output {
my ($fli_output_fasta_unmerged, $alt_fsj_supporting_reads_unmerged, $fli_output_unmerged) = @_;

my %isoform_to_strand;
my %isoform_to_locus;
open my $IN, "<$fli_output_unmerged" or die "can't open $fli_output_unmerged\n";
my $header = <$IN>;
while (<$IN>) {
my @line = split("\t", $_);
my ($isoform, $strand) = ($line[0], $line[5]);
my ($isoform, $locus, $strand) = ($line[0], $line[2], $line[5]);
$isoform_to_strand{$isoform} = $strand;
$isoform_to_locus{$isoform} = $locus;
}
close $IN;

Expand All @@ -2109,7 +2111,7 @@ sub merge_full_length_output {
}
my $seq = <$IN>;
chomp($seq);
$unique_fli_seqs{$type}{$isoform_to_strand{$fli_name}}{$seq}{$fli_name}++;
$unique_fli_seqs{$type}{$isoform_to_strand{$fli_name}}{$isoform_to_locus{$fli_name}}{$seq}{$fli_name}++;
}
}
close $IN;
Expand All @@ -2118,11 +2120,13 @@ sub merge_full_length_output {

for my $type (keys %unique_fli_seqs) {
for my $strand (keys %{$unique_fli_seqs{$type}}) {
for my $seq (keys %{$unique_fli_seqs{$type}{$strand}}) {
my @merged_fli_names = sort keys %{$unique_fli_seqs{$type}{$strand}{$seq}};
my $merged_fli_name = join(",", @merged_fli_names);
for my $fli_name (@merged_fli_names) {
$unmerged_to_merged_name{$fli_name} = $merged_fli_name;
for my $locus (keys %{$unique_fli_seqs{$type}{$strand}}) {
for my $seq (keys %{$unique_fli_seqs{$type}{$strand}{$locus}}) {
my @merged_fli_names = sort keys %{$unique_fli_seqs{$type}{$strand}{$locus}{$seq}};
my $merged_fli_name = join(",", @merged_fli_names);
for my $fli_name (@merged_fli_names) {
$unmerged_to_merged_name{$fli_name} = $merged_fli_name;
}
}
}
}
Expand Down Expand Up @@ -2891,6 +2895,7 @@ sub check_identical_to_orig_transcript {
chomp;
if ($_ =~ m/^.*:\d+-\d+_(.*)_Exon_Lengths_.*_Offsets_.*_/) {
my $seq = <IN>;
chomp($seq);

my $pure_name = $1;

Expand Down

0 comments on commit a2eae56

Please sign in to comment.