0
|
1 #!/usr/bin/perl -w
|
|
2 use strict;
|
|
3 #usage: perl sorting.pl A/
|
|
4
|
|
5 my @inputs = @ARGV;
|
|
6 chomp(@inputs);
|
|
7
|
|
8 my $dir = $inputs[0];
|
|
9 my $reference = $inputs[1];
|
|
10 my $LINKYX_PATH = $inputs[2];
|
|
11 my $results = "X_results.txt";
|
|
12 my %hash = (); #contig <-> family member with the maximal number of not uniquely mapped reads
|
|
13 my $contig; my $count=0; my $iso;
|
|
14
|
|
15 open(RESULTS_FILE, $results) or die "(sorting.pl) Impossible to open source file: $!\n";
|
|
16
|
|
17 while (<RESULTS_FILE>) {
|
|
18 $contig = $_; chomp($contig);
|
|
19 $count = `bash $LINKYX_PATH/scripts/number_of_not_uniq_mapped_reads.sh $dir $contig`;
|
|
20 $hash{$contig} = $count;
|
|
21 }
|
|
22
|
|
23 foreach (sort {$hash{$a} <=> $hash{$b}} keys %hash) {
|
|
24 print "$_ $hash{$_}";
|
|
25
|
|
26 #get sequence
|
|
27 print "% of not uniquely mapped reads for contig ".$_.": ".$hash{$_}."\n";
|
|
28 system("perl $LINKYX_PATH/scripts/get_sequences_based_on_ids.pl $reference $_");
|
|
29
|
|
30 $iso = `bash $LINKYX_PATH/scripts/isoform_exists.sh $_ references/reference_contig_names`;
|
|
31 if ($iso eq '') {
|
|
32 print "No isoforms.\n";
|
|
33 } else {
|
|
34 print "Isoforms exists:\n";
|
|
35 print $iso;
|
|
36 }
|
|
37 print "----------\n";
|
|
38 } |