File: tier_gene_trans_alignments.pl

package info (click to toggle)
trinityrnaseq 2.11.0%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 417,528 kB
  • sloc: perl: 48,420; cpp: 17,749; java: 12,695; python: 3,124; sh: 1,030; ansic: 983; makefile: 688; xml: 62
file content (43 lines) | stat: -rwxr-xr-x 997 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env perl

use strict;
use warnings;

my $usage = "usage: $0 genes.fasta transcripts.fasta max_intron BLAT_CPU [STRAND-SPECIFIC_FLAG=0]\n\n";

my $genes_fasta = $ARGV[0] or die $usage;
my $trans_fasta = $ARGV[1] or die $usage;
my $max_intron = $ARGV[2] or die $usage;
my $blat_cpu = $ARGV[3] or die $usage;
my $SS = $ARGV[4] || 0;


main: {

    ## run blat:
    my $cmd = "/usr/lib/trinityrnaseq/util/misc/blat_util/process_BLAT_alignments.pl -g $genes_fasta -t $trans_fasta -I $max_intron --CPU $blat_cpu --KEEP_PSLX";

    &process_cmd($cmd);

    $cmd = "cat blat_out_dir/*top_1 > blat.top_1.pslx";
    &process_cmd($cmd);

    $cmd = "/usr/lib/trinityrnaseq/Analysis/FL_reconstruction_analysis/util/blat_top_tier_genes.pl blat.top_1.pslx $SS";
    &process_cmd($cmd);
    
    exit(0);
}

####
sub process_cmd {
    my ($cmd) = @_;

    print STDERR "CMD: $cmd\n";
    my $ret = system($cmd);

    if ($ret) {
        die "Error, cmd: $cmd died with ret $ret";
    }

    return;
}