Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Workshop_SA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TBRU
Workshop_SA
Commits
b232d552
Commit
b232d552
authored
7 years ago
by
Chloe Marie Loiseau
Browse files
Options
Downloads
Patches
Plain Diff
BWA script
parent
c0a25c77
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
notebooks/slurm_scripts/launch_BWA.slurm
+37
-0
37 additions, 0 deletions
notebooks/slurm_scripts/launch_BWA.slurm
with
37 additions
and
0 deletions
notebooks/slurm_scripts/launch_BWA.slurm
0 → 100644
+
37
−
0
View file @
b232d552
#!/bin/bash
#SBATCH --job-name=BWA
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4G
#SBATCH --time=6:00:00
#SBATCH --output=BWA.o
#SBATCH --error=BWA.e
#SBATCH --qos=6hours
### 3.1.1 Making the index
singularity
exec
container.img bwa index
-a
bwtsw ~/Workshop_SA/notebooks/reference_genome/MTB_ancestor_reference.fasta
### 3.1.2 Running BWA
singularity
exec
container.img bwa mem
-M
~/Workshop_SA/notebooks/reference_genome/MTB_ancestor_reference.fasta ERR760779_1P.trimmed.fastq.gz ERR760779_2P.trimmed.fastq.gz
>
ERR760779_paired.sam
singularity
exec
container.img bwa mem
-M
~/Workshop_SA/notebooks/reference_genome/MTB_ancestor_reference.fasta ERR760779_1U.trimmed.fastq.gz
>
ERR760779_1U.sam
singularity
exec
container.img bwa mem
-M
~/Workshop_SA/notebooks/reference_genome/MTB_ancestor_reference.fasta ERR760779_2U.trimmed.fastq.gz
>
ERR760779_2U.sam
### convert the SAM to BAM format
singularity
exec
container.img samtools view
-bhu
ERR760779_paired.sam
>
ERR760779_paired.bam
singularity
exec
container.img samtools view
-bhu
ERR760779_1U.sam
>
ERR760779_1U.bam
singularity
exec
container.img samtools view
-bhu
ERR760779_2U.sam
>
ERR760779_2U.bam
### sort the BAM file by position
singularity
exec
container.img samtools
sort
-m
4G ERR760779_paired.bam
>
ERR760779.sorted.bam
singularity
exec
container.img samtools
sort
-m
4G ERR760779_1U.bam
>
ERR760779_1U.sorted.bam
singularity
exec
container.img samtools
sort
-m
4G ERR760779_2U.bam
>
ERR760779_2U.sorted.bam
### To go faster one could bring the three last commands into one using pipe:
### bwa mem -t 2 -M ~/Workshop_SA/notebooks/reference_genome/MTB_ancestor_reference.fasta ERR760779_1P.trimmed.fastq.gz ERR760779_2P.trimmed.fastq.gz | samtools view -Sbhu -|samtools sort -m 4G - ERR760779_paired.sorted
### 3.1.3 Merging the BAMs
singularity
exec
container.img samtools merge ERR760779_merged.bam ERR760779.sorted.bam ERR760779_1U.sorted.bam ERR760779_2U.sorted.bam
### 3.1.4 Retrieving the unmapped reads
singularity
exec
container.img samtools view
-b
-f
4 ERR760779_merged.bam
>
ERR760779.unmapped.bam
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment