Commit 6003a162 authored by eortega's avatar eortega
Browse files

Coding stye and list of files added to scripts/README.md. README.txt is now README.md

parent 5c73fc0b
......@@ -23,22 +23,22 @@ virus_index=/home/enrique/work/Gandon/coevolution/phages/data/refs/indexes_Sv/Sv
for i in $(find $path_fasta -name *_R1.fq.gz)
for i in $(find $path_fasta -name *_R1.fq.gz)
do
# echo $i
root_name=$(basename -s _R1.fq.gz $i)
root_name=$(basename -s _R1.fq.gz $i)
var=$(dirname $i)
outdir=${var/data\/trimmed/results/mapping}/
echo -e "\n"phage $root_name -\> ${outdir}${root_name}.sam
echo $i ${i/_R1/_R2}
echo -e "\n"phage $root_name -\> ${outdir}${root_name}.sam
echo $i ${i/_R1/_R2}
echo $virus_index
echo "#### MAPPING"
bowtie2 --phred33 -5 12 -p 24 -t -x $virus_index -1 $i -2 ${i/_R1/_R2} -S ${outdir}${root_name}.sam
bowtie2 --phred33 -5 12 -p 24 -t -x $virus_index -1 $i -2 ${i/_R1/_R2} -S ${outdir}${root_name}.sam
echo "#### SORTING"
samtools sort -O BAM -o ${outdir}${root_name}.sort.bam ${outdir}${root_name}.sam
samtools index -b ${outdir}${root_name}.sort.bam
samtools sort -O BAM -o ${outdir}${root_name}.sort.bam ${outdir}${root_name}.sam
samtools index -b ${outdir}${root_name}.sort.bam
done
## Contents of scripts folder
The scripts are numbered in the order they are run.
If in doubt use the scripts which are executable.
A more detailed description of the files is below the list (use ctrl + f)
Files:
* 00_create_py_env.sh
* 01_quality_check.sh*
* 02_trimm_and_clean.sh*
* 03_mapping.sh*
* 04_snpcalling.sh*
* 05b_convert_protospacer_dico2fasta.py*
* 06b_blast_protospaces.sh*
* 07_2_run_vcf_parser_all_files.py
* 07_2_test.py
* 07_run_vcf_parser_all_files.py*
* procedure.sh
* README.txt
* requirements_py-env.txt
* vcf_parser3.py
Folders:
* debug
* lib
* __pycahce__
## Coding practices
I tried to use as much as possible the Python Enhancement Proposal 8 (PEP-8). https://www.python.org/dev/peps/pep-0008/
A difference I use regularl is using double `##` at the begining of a line containing comments.
During the developement stages I comment some code lines that would be uncommented as a block. Having two '#' signs un real comments allows not to mistake them for command lines.
Example:
```python
## This block of code calculate the proportion
for i in input_list:
# print("proportion of the list")
print(i / sum(list))
```
Concerning bash coding I use often double spaces to separate commands, parameters, and arguments. When using some long names it makes things more readable
Example:
```bash
for i in $(find $path_fasta -name *_R1.fq.gz)
do
# echo $i
root_name=$(basename -s _R1.fq.gz $i)
var=$(dirname $i)
outdir=${var/data\/trimmed/results/mapping}/
echo -e "\n"phage $root_name -\> ${outdir}${root_name}.sam
echo $i ${i/_R1/_R2}
echo $virus_index
echo "#### MAPPING"
bowtie2 --phred33 -5 12 -p 24 -t -x $virus_index -1 $i -2 ${i/_R1/_R2} -S ${outdir}${root_name}.sam
echo "#### SORTING"
samtools sort -O BAM -o ${outdir}${root_name}.sort.bam ${outdir}${root_name}.sam
samtools index -b ${outdir}${root_name}.sort.bam
done
```
Sometimes I'll put the arguments in different lines having an indentation:
```bash
## A command with multiple parameters seaprated per line
samtools sort \
-O BAM \
-o ${outdir}${root_name}.sort.bam \
${outdir}${root_name}.sam
## Short commands in one single line
samtools index -b ${outdir}${root_name}.sort.bam
```
......@@ -3,7 +3,7 @@
The scripts are numbered in the order they are run.
If in doubt use the scripts which are executable.
The description of the files is here below
A more detailed description of the files is below the list (use ctrl + f)
Files:
......@@ -26,7 +26,64 @@ Files:
Folders:
* debug
* lib
* __pycahce__
Files to ignore for a while ^_^
###
\ No newline at end of file
## Coding practices
I tried to use as much as possible the Python Enhancement Proposal 8 (PEP-8). https://www.python.org/dev/peps/pep-0008/
A difference I use regularl is using double `##` at the begining of a line containing comments.
During the developement stages I comment some code lines that would be uncommented as a block. Having two '#' signs un real comments allows not to mistake them for command lines.
Example:
```python
## This block of code calculate the proportion
for i in input_list:
# print("proportion of the list")
print(i / sum(list))
```
Concerning bash coding I use often double spaces to separate commands, parameters, and arguments. When using some long names it makes things more readable
Example:
```bash
for i in $(find $path_fasta -name *_R1.fq.gz)
do
# echo $i
root_name=$(basename -s _R1.fq.gz $i)
var=$(dirname $i)
outdir=${var/data\/trimmed/results/mapping}/
echo -e "\n"phage $root_name -\> ${outdir}${root_name}.sam
echo $i ${i/_R1/_R2}
echo $virus_index
echo "#### MAPPING"
bowtie2 --phred33 -5 12 -p 24 -t -x $virus_index -1 $i -2 ${i/_R1/_R2} -S ${outdir}${root_name}.sam
echo "#### SORTING"
samtools sort -O BAM -o ${outdir}${root_name}.sort.bam ${outdir}${root_name}.sam
samtools index -b ${outdir}${root_name}.sort.bam
done
```
Sometimes I'll put the arguments in different lines having an indentation:
```bash
## A command with multiple parameters seaprated per line
samtools sort \
-O BAM \
-o ${outdir}${root_name}.sort.bam \
${outdir}${root_name}.sam
## Short commands in one single line
samtools index -b ${outdir}${root_name}.sort.bam
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment