Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libhts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Blaise LI
libhts
Commits
66415b36
Commit
66415b36
authored
Mar 24, 2020
by
Blaise Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make slurm-compatible script.
parent
b5c33ec8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
scripts/bam2bigwig.sh
scripts/bam2bigwig.sh
+4
-6
No files found.
scripts/bam2bigwig.sh
View file @
66415b36
#!/bin/
dash
#!/bin/
bash -l
# Usage: bam2bigwig.sh <sorted.bam> <bin_file> <library_name> <orientation> <strandedness> [<normalization>] <bigwig>
# <bin_file> should be a bed file representing 10 bp bins along the genome
# <orientation> must be "all", "fwd" or "rev"
...
...
@@ -30,7 +30,6 @@
# * python3 -> module load Python/3.6.0
# * samtools -> module load samtools/1.9
# * bedtools -> module load bedtools/2.25.0
# * mawk -> use alias if absent
# * parallel (for niceload) -> module load parallel/20170122
# * UCSC-tools (for bedGraphToBigWig) -> module load UCSC-tools/v373
...
...
@@ -66,7 +65,6 @@ error_exit ()
exit
1
}
mawk
--version
1> /dev/null 2> /dev/null
||
alias
mawk
=
'awk'
load_tools
||
error_exit
"Some tools are not available"
...
...
@@ -74,7 +72,7 @@ bam=${1}
bin_file
=
${
2
}
# Example of how to generate the bin_file from iGenome data:
# cd /Genomes/C_elegans
#
m
awk '$1 == "@SQ" {print $2"\t0\t"$3}' Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/WholeGenomeFasta/genome.dict \
# awk '$1 == "@SQ" {print $2"\t0\t"$3}' Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/WholeGenomeFasta/genome.dict \
# | sed 's/SN://g' | sed 's/LN://' \
# | bedops --chop 10 - \
# > Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/genome_binned_10.bed
...
...
@@ -163,7 +161,7 @@ fi
echo
"getting chromosome bounds"
genome_file
=
"
${
workdir
}
/chrom_sizes.txt"
samtools view
-H
${
bam
}
\
|
m
awk
'$1 == "@SQ" {print $2"\t"$3}'
\
|
awk
'$1 == "@SQ" {print $2"\t"$3}'
\
|
sed
's/SN://g'
|
sed
's/LN://'
\
>
${
genome_file
}
||
error_exit
"making
${
genome_file
}
failed"
#> ${genome_file} || cleanup && error_exit "making ${genome_file} failed"
...
...
@@ -172,7 +170,7 @@ compute_coverage()
{
cmd
=
"niceload --noswap bedtools genomecov -bg -split
${
orient_filter
}
${
scaling
}
-ibam
${
bam
}
"
eval
${
cmd
}
\
|
m
awk
'{ print $1"\t"$2"\t"$3"\tid-"NR"\t"$4; }'
| sort-bed -
\
|
awk
'{ print $1"\t"$2"\t"$3"\tid-"NR"\t"$4; }'
| sort-bed -
\
||
error_exit
"compute_coverage failed"
#|| cleanup && error_exit "compute_coverage failed"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment