Skip to content

Commit

Permalink
Update wrapper a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
mourisl committed Aug 3, 2016
1 parent 353d425 commit 41dfcc9
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions rascaf-wrapper.pl
Expand Up @@ -16,12 +16,14 @@
my $WD = dirname( abs_path( $0 ) ) ;

my $usage = "perl rascaf-wrapper.pl [OPTIONS]:\n".
"\t-b STRING: bam file. Can use multiple -b to specify multiple alignment files[required]\n".
"\t-b STRING: bam file. Can use comma-separator to specify multiple alignment files[required]\n".
"\t-f STRING: path to the raw assembly fasta file\n".
"\t-o STRING : prefix of the output file (default: rascaf_scaffold)".
"\t-ms INT: minimum support for connecting two contigs(default: 2)".
"\t-ml INT: minimum exonic length if no intron (default: 200)".
"\t-k INT: the size of a kmer(<=32. default: 21)" ;
"\t-o STRING : prefix of the output file (default: rascaf_scaffold)\n".
"\t-ms INT: minimum support for connecting two contigs(default: 2)\n".
"\t-ml INT: minimum exonic length if no intron (default: 200)\n".
"\t-k INT: the size of a kmer(<=32. default: 21)\n" ;

die $usage if ( scalar( @ARGV ) == 0 ) ;

my %oneParaOptions ;
$oneParaOptions{ "-f" } = 1 ;
Expand All @@ -33,12 +35,17 @@
{
if ( $ARGV[ $i ] eq "-b" )
{
my $tmp = $ARGV[$i + 1] ;
push @bamFiles, $tmp ;

$tmp = basename( $tmp ) ;
$tmp =~ s/\.bam$// ;
push @bamFilePrefix, $tmp ;
my @files = split /,/, $ARGV[$i + 1] ;

for ( my $j = 0 ; $j < scalar( @files ) ; ++$j )
{
my $tmp = $files[$j] ;
push @bamFiles, $tmp ;

$tmp = basename( $tmp ) ;
$tmp =~ s/\.bam$// ;
push @bamFilePrefix, $tmp ;
}

++$i ;

Expand Down Expand Up @@ -75,7 +82,7 @@
my $cmd = "$WD/rascaf -b ".$bamFiles[$i]." -o ".$bamFilePrefix[$i]."_$i @rascafARGV" ;
print STDERR $cmd, "\n" ;
die "rascaf failed.\n" if ( system( $cmd ) != 0 ) ;
$joinList .= "-r ".$bamFilePrefix[$i]."_$i".".out" ;
$joinList .= " -r ".$bamFilePrefix[$i]."_$i".".out" ;
}

my $cmd = "$WD/rascaf-join $joinList @rascafJoinARGV" ;
Expand Down

0 comments on commit 41dfcc9

Please sign in to comment.