Skip to content

Commit

Permalink
remove hardcoded path from cobbler/rails
Browse files Browse the repository at this point in the history
  • Loading branch information
warrenlr committed Jun 8, 2018
1 parent 81e2ed2 commit 582876c
Show file tree
Hide file tree
Showing 17 changed files with 3,017 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ RUN apt-get update -qq && apt-get install -y bwa wget cpanminus
#
# Download the software
#
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
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

#
# Set the default working directory
#
WORKDIR /RAILS_v1.1
WORKDIR /RAILS_v1.4.1
15 changes: 10 additions & 5 deletions bin/RAILS
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,21 @@
use strict;
use Getopt::Std;
use Net::SMTP;
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);
getopts('f:s:d:e:l:a:v:b:t:p:i:q:g:');
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);
getopts('f:s:d:e:l:a:v:b:t:p:i:q:g:p:');
my ($base_name,$anchor,$seqid,$insert_stdev,$min_links,$max_link_ratio,$grace,$verbose)=("",1000,0.9,1.0,1,0.99,1,0,);

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

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

my $assemblyruninfo="";

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

if(! -e $SAMPATH){
die "Invalid: $SAMPATH -- fatal\n";
}

### Naming output files
if ($base_name eq ""){
Expand Down
16 changes: 10 additions & 6 deletions bin/cobbler.pl
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@
use strict;
use Getopt::Std;
use Net::SMTP;
use vars qw($opt_f $opt_s $opt_d $opt_i $opt_v $opt_b $opt_t $opt_q $opt_l $opt_g);
getopts('f:s:d:v:b:t:i:q:g:l:');
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);
getopts('f:s:d:v:b:t:i:q:g:l:p:');
my ($base_name,$anchor,$seqid,$verbose,$minreads,$grace)=("",1000,0.9,0,1,1);

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

#-------------------------------------------------

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

my $assemblyruninfo="";

Expand All @@ -68,7 +70,9 @@
if(! -e $fof){
die "Invalid file: $fof -- fatal\n";
}

if(! -e $SAMPATH){
die "Invalid : $SAMPATH -- fatal\n";
}

### Naming output files
if ($base_name eq ""){
Expand Down
8 changes: 4 additions & 4 deletions bin/runRAILS.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#RLW 2016
if [ $# -ne 4 ]; then
echo "Usage: $(basename $0) <FASTA assembly .fa> <FASTA long sequences .fa> <anchoring sequence length eg. 250> <min sequence identity 0.95>"
if [ $# -ne 5 ]; then
echo "Usage: $(basename $0) <FASTA assembly .fa> <FASTA long sequences .fa> <anchoring sequence length eg. 250> <min sequence identity 0.95> <path to samtools>"
exit 1
fi
###Change line below to point to path of bwa executables
Expand All @@ -21,7 +21,7 @@ bwa mem -a -t4 $1-formatted.fa $2-formatted.fa | samtools view -Sb - > $2_vs_$1_
echo Scaffolding $1-formatted.fa using $2-formatted.fa and filling gaps with sequences in $2-formatted.fa
echo $2-formatted.fa > $2-formatted.fof
echo $2_vs_$1_gapfilling.bam > $2_vs_$1_gapfilling.fof
../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
../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
echo Process terminated.
echo RAILS scaffolding $1.gapsFill.fa sequences using long seqs $2 -- anchoring sequence threshold $3 bp
echo reformatting file $1.gapsFill.fa
Expand All @@ -34,5 +34,5 @@ bwa mem -a -t4 $2_vs_$1_$3_$4_gapsFill-formatted.fa $2-formatted.fa | samtools v
echo Scaffolding $2_vs_$1_$3_$4_gapsFill-formatted.fa using $2-formatted.fa and filling new gaps with sequences in $2-formatted.fa
echo $2-formatted.fa > $2-formatted.fof
echo $2_vs_$1_scaffolding.bam > $2_vs_$1_scaffolding.fof
../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
../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
echo RAILS process terminated.
23 changes: 14 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
![Logo](https://github.com/warrenlr/rails/blob/master/rails-logo.png)

# RAILS v1.4 and Cobbler v0.5
# RAILS v1.4.1 and Cobbler v0.5.1
## Rene L. Warren, 2014-2018
## email: rwarren at bcgsc.ca

### Name
-------------

RAILS: Radial Assembly Improvement by Long Sequence Scaffolding

Cobbler: Gap-filling with long sequences


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

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


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

<pre>
gunzip rails_v1-4.tar.gz
tar -xvf rails_v1-4.tar
gunzip rails_v1-4-1.tar.gz
tar -xvf rails_v1-4-1.tar
</pre>

Alternatively, individual tools are available within the github repository
Expand All @@ -57,6 +56,8 @@ Alternatively, individual tools are available within the github repository
-------------

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


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

You may need to change both runme.sh and runmeHuman.sh to specify the path of samtools on your system

1. SARS:
execute runme.sh
(./runme.sh)
Expand Down Expand Up @@ -94,7 +97,7 @@ Software. doi: 10.21105/joss.00116

<pre>
./runRAILS.sh
Usage: runRAILS.sh <FASTA assembly .fa> <FASTA long sequences .fa> <anchoring sequence length eg. 250> <min sequence identity 0.95>
Usage: runRAILS.sh <FASTA assembly .fa> <FASTA long sequences .fa> <anchoring sequence length eg. 250> <min sequence identity 0.95> <path to samtools>

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

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


Usage: ./RAILS [v1.4]
Usage: ./RAILS [v1.4.1]
-f Assembled Sequences to further scaffold (Multi-Fasta format, required)
-q File of filenames containing long Sequences queried (Multi-Fasta format, required)
-s File of filenames containing full path to BAM file(s)
-p Full path to samtools (known to work/tested with v1.8, required)
-d Anchoring bases on contig edges (ie. minimum required alignment size on contigs, default -d 1000, optional)
-i Minimum sequence identity fraction (0 to 1), default -i 0.9, optional
-t LIST of names/header, long sequences to avoid using for merging/gap-filling scaffolds (optional)
Expand Down
Binary file added tarball/rails_v1-4-1.tar.gz
Binary file not shown.
Loading

0 comments on commit 582876c

Please sign in to comment.