In [ ]:
# sra-toolkit can be installed into different path on different platforms
bin_prefetch=$(which prefetch)
bin_sam-dump=$(which sam-dump)
output_dir="../data"
accessions="SRR3879778 SRR3879779 SRR3879780 SRR4244377 SRR4244378 SRR4244385"
base_url="https://s3.us-east-2.amazonaws.com/nudlerlab/rpoS/"
In [ ]:
# This will output replicate .bam files as one combined file
for accession in $accessions
do
$bin_prefetch $accession
$bin_sam-dump -u $sra_dir/$accession \
| samtools view -bhS - > $output_dir/$accession
done
In [ ]:
# This ill download original untouched .bam files we received
# from the sequencing facility
files=$(cat ../data/datafiles.txt | cut -f11 -d' ' | grep bam)
for f in $files
do
wget $base_url/$f -P $output_dir
done