forked from liangclab/HERA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path09-Qsub-Pair_Alignment_minimap2.pl
executable file
·58 lines (54 loc) · 1.48 KB
/
09-Qsub-Pair_Alignment_minimap2.pl
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/perl
#Author: huilong du
#Note: align the corrected pacbios and non-scaffolded contigs selfly
use warnings;
use strict;
my $infile=shift;
my $script=shift;
my $queue=shift;
my $genome=shift;
open IN,"<$infile" or die $!;
my $count=1;
my @part=();
while(<IN>){
chomp;
my $line=$_;
push(@part,$line);
}
close(IN);
for(my $i=0;$i<@part;$i++){
for(my $j=$i;$j<@part;$j++){
open OUT,">$count.pbs" or die $!;
if($count<350){
print OUT "#BSUB -J $genome-Pair-$i-$j
#BSUB -o $count.out
#BSUB -n 2
#BSUB -q $queue
";
}
elsif($count>=350){
print OUT "#BSUB -J $genome-Pair-$i-$j
#BSUB -o $count.out
#BSUB -n 2
#BSUB -q $queue
";
}
if($i==$j){
print OUT "
minimap2 -ax asm5 -t 4 $part[$i].mmi $part[$j] >./03-Pacbio-SelfAlignment/Part_SelfAlignment_$i-$j.sam
perl $script/sam2blasr.pl ./03-Pacbio-SelfAlignment/Part_SelfAlignment_$i-$j.sam ./03-Pacbio-SelfAlignment/Part_SelfAlignment_$i-$j.txt
rm -f ./03-Pacbio-SelfAlignment/Part_SelfAlignment_$i-$j.sam
";
}
else{
print OUT "
minimap2 -ax asm5 -t 4 $part[$i].mmi $part[$j] >./03-Pacbio-SelfAlignment/Part_SelfAlignment_$i-$j.sam
perl $script/sam2blasr.pl ./03-Pacbio-SelfAlignment/Part_SelfAlignment_$i-$j.sam ./03-Pacbio-SelfAlignment/Part_SelfAlignment_$i-$j.txt
rm -f ./03-Pacbio-SelfAlignment/Part_SelfAlignment_$i-$j.sam
";
}
close(OUT);
system("qsub -cwd -V -l vf=10g,p=2 -o $count.out -q $queue -e log/ -N $genome-Pair-$i-$j < $count.pbs");
$count++;
}
}