Skip to content

Commit

Permalink
prepare for the first release
Browse files Browse the repository at this point in the history
  • Loading branch information
Serghei Mangul committed Jul 23, 2018
1 parent e01427a commit d2229d0
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 56 deletions.
100 changes: 50 additions & 50 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ fi





# Set default options.
CLEAN_ONLY=false
FORCE=false
Expand All @@ -43,77 +41,79 @@ fi


declare -A DB_ID_HUMAN=(
['viral_vipr']='1fIxhnwNSPj6NL2R44bqYkYu2T8OLfqpk'
['fungi']='1yBeBjnrnHtxZliruu3oC8NjZ3wHg-WQ3'
['BWAindex']='19Uscw8KrPyUiuPcErrXpyOxN0PqUtbOZ'
['protozoa']='1_dPn8kk3I--Icy0gwTorFneV1sor1dU2'
)

declare -A DB_MD5_HUMAN=(
['viral_vipr']='9dce447328dfbc3a62cc7dd5b052242f'
['fungi']='9f2d304fd5c49981682b2bb7a900a30e'
['BWAindex']='4f009e3732d9f513e7b19b58edc41c13'
['protozoa']='23e12115a5e9d526553c901e772731f5'
)


ORGANISM='human'
download_list=$'BWAindex'
download_list=$'BWAindex\nviral_vipr\nfungi\nprotozoa'







cd "$DB_LOCATION"
mkdir "db_$ORGANISM"
cd "db_$ORGANISM"


#echo '----- Downloading hg38 human reference ----------------------------------------------------'
#for download in $download_list; do
#echo "Downloading item: $download for $ORGANISM"
#success=false
#while [ $success = false ]; do
#case "$ORGANISM" in
#human)
#db_id="${DB_ID_HUMAN[$download]}"
#db_md5="${DB_MD5_HUMAN[$download]}"
#;;
#mouse)
#db_id="${DB_ID_MOUSE[$download]}"
#db_md5="${DB_MD5_MOUSE[$download]}"
#;;
#*)
#echo 'Error: Unknown ORGANISM.' >&2
#exit 1
#;;
#esac
#confirm_code=`curl --silent --insecure --cookie-jar cookies.txt "https://docs.google.com/uc?export=download&id=$db_id" | sed -rn 's .*confirm=([0-9A-Za-z_]+).* \1\n p'`

#curl --location --insecure --cookie cookies.txt \"https://docs.google.com/uc?export=download&confirm=$confirm_code&id=$db_id\" >$download.tar.gz


echo '----- Downloading human and mirobial references ----------------------------------------------------'
for download in $download_list; do
echo "Downloading item: $download for $ORGANISM"
success=false
while [ $success = false ]; do
case "$ORGANISM" in
human)
db_id="${DB_ID_HUMAN[$download]}"
db_md5="${DB_MD5_HUMAN[$download]}"
;;
mouse)
db_id="${DB_ID_MOUSE[$download]}"
db_md5="${DB_MD5_MOUSE[$download]}"
;;
*)
echo 'Error: Unknown ORGANISM.' >&2
exit 1
;;
esac
confirm_code=`curl --silent --insecure --cookie-jar cookies.txt "https://docs.google.com/uc?export=download&id=$db_id" | sed -rn 's .*confirm=([0-9A-Za-z_]+).* \1\n p'`
curl --location --insecure --cookie cookies.txt "https://docs.google.com/uc?export=download&confirm=$confirm_code&id=$db_id" >$download.tar.gz




#rm cookies.txt
#if [ `md5sum "$download.tar.gz" | sed 's \(.*\)\ .* \1 '` = "$db_md5" ]; then
#tar -zxvf "$download.tar.gz"
#rm "$download.tar.gz"
#success=true
#else
#echo "Download of $download for $ORGANISM failed (checksum" \
#'mismatch. Retrying.'
#fi
#done
#done

rm cookies.txt
if [ `md5sum "$download.tar.gz" | sed 's \(.*\)\ .* \1 '` = "$db_md5" ]; then
tar -zxvf "$download.tar.gz"
rm "$download.tar.gz"
success=true
else
echo "Download of $download for $ORGANISM failed (checksum" \
'mismatch. Retrying.'
fi
done
done



#ADD----------
#./conda install -c dranew hmmcopy_utils
#git clone https://github.com/broadinstitute/ichorCNA.git
#conda install -c r r-base
#old conda install -c bioconda r-optparse
#old source("https://bioconductor.org/biocLite.R")
#old biocLite("HMMcopy")

#biocLite("GenomeInfoDb")

#install.packages("devtools")
#library(devtools)
#install_github("broadinstitute/ichorCNA", "--no-docs")

# ------------------------------------------------------------------------------
# DOWNLOAD TOOLS
Expand Down Expand Up @@ -143,10 +143,10 @@ else

#Download megahit
echo '----- Downloading Megahit --------------------------------------------------'
#git clone https://github.com/voutcn/megahit.git
#cd megahit
#make
#cd ..
git clone https://github.com/voutcn/megahit.git
cd megahit
make
cd ..



Expand Down
12 changes: 6 additions & 6 deletions needle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ UNMAPPED=${SAMPLE}.unmapped.fastq



bwa mem -a ${DIR_CODE}/db.microbiome/viral.vipr/NONFLU_All.fastq $UNMAPPED | samtools view -S -b -F 4 - | samtools sort - >${SAMPLE}.virus.bam
bwa mem -a ${DIR_CODE}/db.microbiome/fungi/fungi.ncbi.february.3.2018.fasta $UNMAPPED | samtools view -S -b -F 4 - | samtools sort - >${SAMPLE}.fungi.bam
bwa mem -a ${DIR_CODE}/db.microbiome/protozoa/protozoa.ncbi.february.3.2018.fasta $UNMAPPED | samtools view -S -b -F 4 - | samtools sort - >${SAMPLE}.protozoa.bam
bwa mem -a ${DB}/viral.vipr/NONFLU_All.fastq $UNMAPPED | samtools view -S -b -F 4 - | samtools sort - >${SAMPLE}.virus.bam
bwa mem -a ${DB}/fungi/fungi.ncbi.february.3.2018.fasta $UNMAPPED | samtools view -S -b -F 4 - | samtools sort - >${SAMPLE}.fungi.bam
bwa mem -a ${DB}/protozoa/protozoa.ncbi.february.3.2018.fasta $UNMAPPED | samtools view -S -b -F 4 - | samtools sort - >${SAMPLE}.protozoa.bam

samtools index ${SAMPLE}.virus.bam
samtools index ${SAMPLE}.fungi.bam
Expand Down Expand Up @@ -154,9 +154,9 @@ samtools view -F 4 ${SAMPLE}.megahit.contigs.protozoa.bam | grep -v -e 'XA:Z:'
echo "-----------------------------------------------------"
echo "Map assembled contigs onto the microbial references"

bwa mem -a ${DIR_CODE}/db.microbiome/viral.vipr/NONFLU_All.fastq ${SAMPLE}.virus.megahit.contigs.fa | samtools view -bS -F 4 - >${SAMPLE}.virus.megahit.contigs.SV.bam
bwa mem -a ${DIR_CODE}/db.microbiome/fungi/fungi.ncbi.february.3.2018.fasta ${SAMPLE}.fungi.megahit.contigs.fa | samtools view -bS -F 4 - >${SAMPLE}.fungi.megahit.contigs.SV.bam
bwa mem -a ${DIR_CODE}/db.microbiome/protozoa/protozoa.ncbi.february.3.2018.fasta ${SAMPLE}.protozoa.megahit.contigs.fa | samtools view -bS -F 4 ->${SAMPLE}.protozoa.megahit.contigs.SV.bam
bwa mem -a ${DB}/viral.vipr/NONFLU_All.fastq ${SAMPLE}.virus.megahit.contigs.fa | samtools view -bS -F 4 - >${SAMPLE}.virus.megahit.contigs.SV.bam
bwa mem -a ${DB}/fungi/fungi.ncbi.february.3.2018.fasta ${SAMPLE}.fungi.megahit.contigs.fa | samtools view -bS -F 4 - >${SAMPLE}.fungi.megahit.contigs.SV.bam
bwa mem -a ${DB}/protozoa/protozoa.ncbi.february.3.2018.fasta ${SAMPLE}.protozoa.megahit.contigs.fa | samtools view -bS -F 4 ->${SAMPLE}.protozoa.megahit.contigs.SV.bam



Expand Down

0 comments on commit d2229d0

Please sign in to comment.