Created
October 31, 2012 18:25
-
-
Save meren/3988883 to your computer and use it in GitHub Desktop.
Merge partially overlapped Illumina reads from demultiplexed CASAVA output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# example command line: | |
# | |
# ./run_merge_illumina_reads Sample_202_11M /PATH/TO/CASAVA/OUTPUT/Sample_202_11M/ /PATH/TO/OUTPUT/DIR/RESULTS meren@mbl.edu | |
# | |
# Note: Running this command line will remove /PATH/TO/OUTPUT/DIR/RESULTS/Sample_202_11M/ directory | |
# if it exists, without asking for your confirmation. | |
# | |
# | |
# If you have more than one sample to run, you can create a run script to run all of them at once. | |
# Here is an example: | |
# | |
# ---->8---->8---->8---->8---->8---->8---->8---->8---->8---->8---->8----- | |
# #!/bin/bash | |
# | |
# for sample in Sample_202_6M Sample_208_5M Sample_208_9M Sample_209_5M Sample_209_6M | |
# do | |
# clusterize "./run_merge_illumina_reads $sample /xraid2-2/sequencing/Illumina/20121026hs/Project_HMP/$sample/ /xraid2-2/sequencing/Illumina/20121026hs/Project_HMP/RESULTS/ meren@mbl.edu" | |
# done | |
# ---->8---->8---->8---->8---->8---->8---->8---->8---->8---->8---->8----- | |
# | |
project_name=$1 | |
input_dir=$2 | |
output_dir=$3 | |
if [ ! -z $4 ]; then | |
e_mail=$4 | |
else | |
e_mail="researcher@unknown-domain" | |
fi | |
config_file="$output_dir/$project_name/config.ini" | |
if [ ! -d "$output_dir" ]; then | |
mkdir $output_dir | |
fi | |
if [ -d "$output_dir/$project_name" ]; then | |
rm -rf "$output_dir/$project_name" | |
mkdir "$output_dir/$project_name" | |
fi | |
if [ ! -d "$output_dir/$project_name" ]; then | |
mkdir "$output_dir/$project_name" | |
fi | |
echo "[general] | |
project_name = $project_name | |
researcher_email = $e_mail | |
input_directory = $input_dir | |
output_directory = $output_dir/$project_name | |
[files] | |
pair_1 = `ls $input_dir/*R1* | awk 'BEGIN{FS="/"; PAIRS=""}{PAIRS=PAIRS", "$NF}END{printf(substr(PAIRS, 3, length(PAIRS))"\n")}'` | |
pair_2 = `ls $input_dir/*R2* | awk 'BEGIN{FS="/"; PAIRS=""}{PAIRS=PAIRS", "$NF}END{printf(substr(PAIRS, 3, length(PAIRS))"\n")}'` | |
" > $config_file | |
# start merging on config file | |
python /bioware/pythonmodules/illumina-utils/scripts/merge-illumina-pairs $config_file $project_name --skip-qual-dicts --min-overlap-size 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment