Protocol for making mpileup files from FASTQ files using BWA
Septermber 26, 2018
Author: Takahiro Maruki
This package can be downloaded by clicking "Clone or download" on this web site.
Instructions
- Compile the programs by typing the following commands:
chmod u+x B_Adapters.pl
chmod u+x N_Adapters.pl
g++ -o Make_Scripts_IU Make_Scripts_IU.cpp -lm
g++ -o Make_JobScripts_IU Make_JobScripts_IU.cpp -lm
g++ -o Make_SubmitJobs_IU Make_SubmitJobs_IU.cpp -lm
- These programs are found and compiled in the following directory:
/N/dc2/projects/daphpops/Software_BWA_Protocol/
-
Make a working directory for the data.
For example, type the following command to make a directory called KAP_DataPrep:
mkdir KAP_DataPrep -
Prepare a text file of barcode sequences.
- Example file in KAP using the Bioo kit (KAP_barcodes.txt) is found in the following directory
/N/dc2/projects/daphpops/Population_samples/KAP2013 - Example file in SH using the Nextera kit (SH_barcodes.txt) is found in the following directory:
/N/dc2/projects/daphpops/Population_samples/SH
-
Prepare isolate-specific FASTA files of adapter sequences in the working directory.
a. For example, to make isolate-specific FASTA files of adapter sequences in KAP, where the Bioo kit was used in the library preparation, type the following command:
perl /N/dc2/projects/daphpops/Software_BWA_Protocol/B_Adapters.pl /N/dc2/projects/daphpops/Population_samples/KAP2013/KAP_barcodes.txt
b. For example, to make isolate-specific FASTA files of adapter sequences in SH, where the Nextera kit was used in the library preparation, type the following command:
perl /N/dc2/projects/daphpops/Software_BWA_Protocol/N_Adapters.pl /N/dc2/projects/daphpops/Population_samples/SH/SH_barcodes.txt -
Make text files of isolate IDs and FASTQ files and have them in the working directory.
For example, the text file of isolate IDs in KAP can be made by typing the following command in the working directory:
ls *.fa | cut -c-9 > IDs_KAP.txt
For example, the text file of FASTQ files in KAP can be made by typing the following command in a directory containing the files:
ls *.fastq > FASTQs_KAP.txt
- The order of the isolate IDs need to be consistent in the two files.
- Make scripts for preparing mpileup files for each of the individuals using Make_Scripts_IU.
For example, type the following command to make the scripts in KAP.
/N/dc2/projects/daphpops/Software_BWA_Protocol/Make_Scripts_IU -wd /N/dc2/scratch/xxxxxxx/KAP_DataPrep -lf FASTQs_KAP.txt -li IDs_KAP.txt -sd /N/dc2/projects/daphpops/Software_BWA_Protocol -rd /N/dc2/projects/daphpops/PA42.4.1_reference -rn PA42.4.1 -fd /N/dc2/projects/daphpops/Population_samples/KAP2013
- Substitue your user name for xxxxxxx.
- Type the following command to find the available options:
/N/dc2/projects/daphpops/Software_BWA_Protocol/Make_Scripts_IU -h
-
Make the scripts executable.
For example, type the following command to make the scripts executable in KAP:
chmod u+x KAP-*_Proc.sh -
Make corresponding job scripts using Make_JobScripts_IU.
For example, type the following command to make the job scripts in KAP:
/N/dc2/projects/daphpops/Software_BWA_Protocol/Make_JobScripts_IU -wd /N/dc2/scratch/xxxxxxx/KAP_DataPrep -li IDs_KAP.txt -em xxxxxxx@indiana.edu -t 48:00:00
- Type the following command to find the available options:
/N/dc2/projects/daphpops/Software_BWA_Protocol/Make_JobScripts_IU -h
- Make a script for submitting the jobs using Make_SubmitJobs_IU.
For example, type the following command to make the script in KAP:
/N/dc2/projects/daphpops/Software_BWA_Protocol/Make_SubmitJobs_IU -wd /N/dc2/scratch/xxxxxxx/KAP_DataPrep -li IDs_KAP.txt -out KAP_SubmitJobs.sh
- Type the following command to find the available options:
/N/dc2/projects/daphpops/Software_BWA_Protocol/Make_SubmitJobs_IU -h
- Run the script for submitting the jobs.
For example, type the following commands to submit the KAP jobs:
chmod u+x KAP_SubmitJobs.sh
./KAP_SubmitJobs.sh
- A few jobs may sometimes be skipped in this way. Check whether all the jobs have been submitted by typing the following command:
qstat -au xxxxxxx