Skip to content

Commit 582876c

Browse files
committed
remove hardcoded path from cobbler/rails
1 parent 81e2ed2 commit 582876c

17 files changed

Lines changed: 3017 additions & 26 deletions

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ RUN apt-get update -qq && apt-get install -y bwa wget cpanminus
1616
#
1717
# Download the software
1818
#
19-
RUN wget https://github.com/warrenlr/RAILS/raw/master/rails_v1-1.tar.gz && tar xvfz rails_v1-1.tar.gz && rm rails_v1-1.tar.gz
19+
RUN wget https://github.com/bcgsc/RAILS/tree/master/tarball/rails_v1-4-1.tar.gz && tar xvfz rails_v1-4-1.tar.gz && rm rails_v1-4-1.tar.gz
2020

2121
#
2222
# Set the default working directory
2323
#
24-
WORKDIR /RAILS_v1.1
24+
WORKDIR /RAILS_v1.4.1

bin/RAILS

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,21 @@
2323
use strict;
2424
use Getopt::Std;
2525
use Net::SMTP;
26-
use vars qw($opt_f $opt_s $opt_d $opt_i $opt_e $opt_l $opt_a $opt_v $opt_b $opt_t $opt_p $opt_q $opt_g);
27-
getopts('f:s:d:e:l:a:v:b:t:p:i:q:g:');
26+
use vars qw($opt_f $opt_s $opt_d $opt_i $opt_e $opt_l $opt_a $opt_v $opt_b $opt_t $opt_p $opt_q $opt_g $opt_p);
27+
getopts('f:s:d:e:l:a:v:b:t:p:i:q:g:p:');
2828
my ($base_name,$anchor,$seqid,$insert_stdev,$min_links,$max_link_ratio,$grace,$verbose)=("",1000,0.9,1.0,1,0.99,1,0,);
2929

30-
my $version = "[v1.4]";
30+
my $version = "[v1.4.1]";
3131
my $dev = "rwarren\@bcgsc.ca";
32-
my $SAMPATH = "/gsc/btl/linuxbrew/bin/samtools";
32+
my $SAMPATH = "";
3333
#-------------------------------------------------
3434

35-
if(! $opt_f || ! $opt_s || ! $opt_q){
35+
if(! $opt_f || ! $opt_s || ! $opt_q || ! $opt_p){
3636
print "Usage: $0 $version\n";
3737
print "-f Assembled Sequences to further scaffold (Multi-Fasta format, required)\n";
3838
print "-q File of filenames containing long Sequences queried (Multi-Fasta format, required)\n";
3939
print "-s File of filenames containing full path to BAM file(s)\n";
40+
print "-p Full path to samtools (known to work/tested with v1.8, required)\n";
4041
print "-d Anchoring bases on contig edges (ie. minimum required alignment size on contigs, default -d $anchor, optional)\n";
4142
print "-i Minimum sequence identity fraction (0 to 1), default -i $seqid, optional\n";
4243
print "-t LIST of names/header, long sequences to avoid using for merging/gap-filling scaffolds (optional)\n";
@@ -62,6 +63,7 @@ $max_link_ratio = $opt_a if($opt_a);
6263
my $listfile = $opt_t if($opt_t);
6364
$base_name = $opt_b if($opt_b);
6465
$grace = $opt_g if($opt_g);
66+
$SAMPATH = $opt_p if($opt_p);
6567

6668
my $assemblyruninfo="";
6769

@@ -73,6 +75,9 @@ if(! -e $fof){
7375
die "Invalid file: $fof -- fatal\n";
7476
}
7577

78+
if(! -e $SAMPATH){
79+
die "Invalid: $SAMPATH -- fatal\n";
80+
}
7681

7782
### Naming output files
7883
if ($base_name eq ""){

bin/cobbler.pl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,22 @@
2323
use strict;
2424
use Getopt::Std;
2525
use Net::SMTP;
26-
use vars qw($opt_f $opt_s $opt_d $opt_i $opt_v $opt_b $opt_t $opt_q $opt_l $opt_g);
27-
getopts('f:s:d:v:b:t:i:q:g:l:');
26+
use vars qw($opt_f $opt_s $opt_d $opt_i $opt_v $opt_b $opt_t $opt_q $opt_l $opt_g $opt_p);
27+
getopts('f:s:d:v:b:t:i:q:g:l:p:');
2828
my ($base_name,$anchor,$seqid,$verbose,$minreads,$grace)=("",1000,0.9,0,1,1);
2929

30-
my $version = "[v0.5]";
30+
my $version = "[v0.5.1]";
3131
my $dev = "rwarren\@bcgsc.ca";
32-
my $SAMPATH = "/gsc/btl/linuxbrew/bin/samtools";
32+
my $SAMPATH = "";
3333

3434
#-------------------------------------------------
3535

36-
if(! $opt_f || ! $opt_s || ! $opt_q){
36+
if(! $opt_f || ! $opt_s || ! $opt_q || ! $opt_p){
3737
print "Usage: $0 $version\n";
3838
print "-f Assembled Sequences to further scaffold (Multi-FASTA format NO LINE BREAKS, required)\n";
3939
print "-q File of filenames containing long Sequences queried (Multi-FASTA format NO LINE BREAKS, required)\n";
4040
print "-s File of filenames containing full path to BAM file(s) (use v0.2 for reading SAM files)\n";
41+
print "-p Full path to samtools (known to work/tested with v1.8, required)\n";
4142
print "-d Anchoring bases on contig edges (ie. minimum required alignment size on contigs, default -d $anchor, optional)\n";
4243
print "-i Minimum sequence identity fraction (0 to 1), default -i $seqid, optional\n";
4344
print "-l Minimum number of long sequence support per gap, default -l $minreads, optional\n";
@@ -58,6 +59,7 @@
5859
$base_name = $opt_b if($opt_b);
5960
$grace = $opt_g if($opt_g);
6061
$minreads = $opt_l if($opt_l);
62+
$SAMPATH = $opt_p if($opt_p);
6163

6264
my $assemblyruninfo="";
6365

@@ -68,7 +70,9 @@
6870
if(! -e $fof){
6971
die "Invalid file: $fof -- fatal\n";
7072
}
71-
73+
if(! -e $SAMPATH){
74+
die "Invalid : $SAMPATH -- fatal\n";
75+
}
7276

7377
### Naming output files
7478
if ($base_name eq ""){

bin/runRAILS.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
#RLW 2016
3-
if [ $# -ne 4 ]; then
4-
echo "Usage: $(basename $0) <FASTA assembly .fa> <FASTA long sequences .fa> <anchoring sequence length eg. 250> <min sequence identity 0.95>"
3+
if [ $# -ne 5 ]; then
4+
echo "Usage: $(basename $0) <FASTA assembly .fa> <FASTA long sequences .fa> <anchoring sequence length eg. 250> <min sequence identity 0.95> <path to samtools>"
55
exit 1
66
fi
77
###Change line below to point to path of bwa executables
@@ -21,7 +21,7 @@ bwa mem -a -t4 $1-formatted.fa $2-formatted.fa | samtools view -Sb - > $2_vs_$1_
2121
echo Scaffolding $1-formatted.fa using $2-formatted.fa and filling gaps with sequences in $2-formatted.fa
2222
echo $2-formatted.fa > $2-formatted.fof
2323
echo $2_vs_$1_gapfilling.bam > $2_vs_$1_gapfilling.fof
24-
../cobbler.pl -f $1 -s $2_vs_$1_gapfilling.fof -d $3 -i $4 -b $2_vs_$1_$3_$4_gapsFill -q $2-formatted.fof
24+
../cobbler.pl -f $1 -s $2_vs_$1_gapfilling.fof -d $3 -i $4 -b $2_vs_$1_$3_$4_gapsFill -q $2-formatted.fof -p $5
2525
echo Process terminated.
2626
echo RAILS scaffolding $1.gapsFill.fa sequences using long seqs $2 -- anchoring sequence threshold $3 bp
2727
echo reformatting file $1.gapsFill.fa
@@ -34,5 +34,5 @@ bwa mem -a -t4 $2_vs_$1_$3_$4_gapsFill-formatted.fa $2-formatted.fa | samtools v
3434
echo Scaffolding $2_vs_$1_$3_$4_gapsFill-formatted.fa using $2-formatted.fa and filling new gaps with sequences in $2-formatted.fa
3535
echo $2-formatted.fa > $2-formatted.fof
3636
echo $2_vs_$1_scaffolding.bam > $2_vs_$1_scaffolding.fof
37-
../RAILS -f $2_vs_$1_$3_$4_gapsFill-formatted.fa -s $2_vs_$1_scaffolding.fof -d $3 -i $4 -b $2_vs_$1_$3_$4_rails -q $2-formatted.fof
37+
../RAILS -f $2_vs_$1_$3_$4_gapsFill-formatted.fa -s $2_vs_$1_scaffolding.fof -d $3 -i $4 -b $2_vs_$1_$3_$4_rails -q $2-formatted.fof -p $5
3838
echo RAILS process terminated.

readme.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
![Logo](https://github.com/warrenlr/rails/blob/master/rails-logo.png)
2-
3-
# RAILS v1.4 and Cobbler v0.5
1+
# RAILS v1.4.1 and Cobbler v0.5.1
42
## Rene L. Warren, 2014-2018
53
## email: rwarren at bcgsc.ca
64

75
### Name
86
-------------
97

108
RAILS: Radial Assembly Improvement by Long Sequence Scaffolding
11-
129
Cobbler: Gap-filling with long sequences
1310

1411

@@ -32,6 +29,8 @@ You can test the software by executing "runme.sh" in the test folder. A simulate
3229
-------------
3330

3431
RAILS and Cobbler are implemented in PERL and run on any OS where PERL is installed.
32+
Both tools require samtools (tested with v1.8) to read sequence alignment bamfiles.
33+
The runRAILS.sh pipeline requires bwa (see Dependencies below for tested version).
3534

3635

3736
### Community guidelines:
@@ -46,8 +45,8 @@ I encourage the community to contribute to the development of this software, by
4645
Download the tar ball, gunzip and extract the files on your system using:
4746

4847
<pre>
49-
gunzip rails_v1-4.tar.gz
50-
tar -xvf rails_v1-4.tar
48+
gunzip rails_v1-4-1.tar.gz
49+
tar -xvf rails_v1-4-1.tar
5150
</pre>
5251

5352
Alternatively, individual tools are available within the github repository
@@ -57,6 +56,8 @@ Alternatively, individual tools are available within the github repository
5756
-------------
5857

5958
Make sure you have installed bwa (Version: 0.7.15-r1140) and that is is in your path.
59+
Make sure you have installed samtools (Version: 1.8) and that is is in your path.
60+
Compatible tools may be used, but have not been tested fully (eg. minimap2, sambamba)
6061

6162

6263
### Test data
@@ -66,6 +67,8 @@ Make sure you have installed bwa (Version: 0.7.15-r1140) and that is is in your
6667
Go to ./test
6768
(cd test)
6869

70+
You may need to change both runme.sh and runmeHuman.sh to specify the path of samtools on your system
71+
6972
1. SARS:
7073
execute runme.sh
7174
(./runme.sh)
@@ -94,7 +97,7 @@ Software. doi: 10.21105/joss.00116
9497

9598
<pre>
9699
./runRAILS.sh
97-
Usage: runRAILS.sh <FASTA assembly .fa> <FASTA long sequences .fa> <anchoring sequence length eg. 250> <min sequence identity 0.95>
100+
Usage: runRAILS.sh <FASTA assembly .fa> <FASTA long sequences .fa> <anchoring sequence length eg. 250> <min sequence identity 0.95> <path to samtools>
98101

99102
this pipeline will:
100103
1. reformat the assembly file $1
@@ -107,10 +110,11 @@ this pipeline will:
107110
8. Align the reformatted long sequences to your re-formatted cobbler assembly
108111
9. Run RAILS to generate a newly scaffolded assembly draft
109112

110-
Usage: ./cobbler.pl [v0.5]
113+
Usage: ./cobbler.pl [v0.5.1]
111114
-f Assembled Sequences to further scaffold (Multi-FASTA format NO LINE BREAKS, required)
112115
-q File of filenames containing long Sequences queried (Multi-FASTA format NO LINE BREAKS, required)
113116
-s File of filenames containing full path to BAM file(s) (use v0.2 for reading SAM files)
117+
-p Full path to samtools (known to work/tested with v1.8, required)
114118
-d Anchoring bases on contig edges (ie. minimum required alignment size on contigs, default -d 1000, optional)
115119
-i Minimum sequence identity fraction (0 to 1), default -i 0.9, optional
116120
-l Minimum number of long sequence support per gap, default -l 1, optional
@@ -121,10 +125,11 @@ Usage: ./cobbler.pl [v0.5]
121125
IMPORTANT: the order of files in -q and -s MUST match!
122126

123127

124-
Usage: ./RAILS [v1.4]
128+
Usage: ./RAILS [v1.4.1]
125129
-f Assembled Sequences to further scaffold (Multi-Fasta format, required)
126130
-q File of filenames containing long Sequences queried (Multi-Fasta format, required)
127131
-s File of filenames containing full path to BAM file(s)
132+
-p Full path to samtools (known to work/tested with v1.8, required)
128133
-d Anchoring bases on contig edges (ie. minimum required alignment size on contigs, default -d 1000, optional)
129134
-i Minimum sequence identity fraction (0 to 1), default -i 0.9, optional
130135
-t LIST of names/header, long sequences to avoid using for merging/gap-filling scaffolds (optional)

tarball/rails_v1-4-1.tar.gz

54.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)