-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chipseq updates #111
Open
adthrasher
wants to merge
8
commits into
main
Choose a base branch
from
chipseq_updates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Chipseq updates #111
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d3a1280
fix: Paired-end ChIP-Seq
adthrasher a7f0d6b
fix: missing samtools option
adthrasher cbb83af
docs: add clarifying meta and comments
adthrasher d98a1a9
chore: Bump SEAseq to latest release
adthrasher da5b3c1
feat: Add samtools fixmate
adthrasher a51216f
chore: reorder parameters
adthrasher 40ef841
docs: apply suggestions from code review @afrantz
adthrasher 685174b
chore: merge main
adthrasher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,11 @@ import "../../tools/samtools.wdl" | |
import "../../tools/util.wdl" | ||
import "../general/bam-to-fastqs.wdl" as b2fq | ||
#@ except: LineWidth | ||
import "https://raw.githubusercontent.com/stjude/seaseq/2.3/workflows/workflows/mapping.wdl" as seaseq_map | ||
import "https://raw.githubusercontent.com/stjude/seaseq/3.1/workflows/tasks/samtools.wdl" as seaseq_samtools | ||
#@ except: LineWidth | ||
import "https://raw.githubusercontent.com/stjude/seaseq/3.0/workflows/tasks/samtools.wdl" as seaseq_samtools | ||
import "https://raw.githubusercontent.com/stjude/seaseq/3.1/workflows/tasks/seaseq_util.wdl" as seaseq_util | ||
#@ except: LineWidth | ||
import "https://raw.githubusercontent.com/stjude/seaseq/3.0/workflows/tasks/seaseq_util.wdl" as seaseq_util | ||
import "https://raw.githubusercontent.com/stjude/seaseq/3.1/workflows/workflows/mapping.wdl" as seaseq_map | ||
|
||
workflow chipseq_standard { | ||
meta { | ||
|
@@ -31,6 +31,7 @@ workflow chipseq_standard { | |
parameter_meta { | ||
bam: "Input BAM format file to realign with bowtie" | ||
bowtie_indexes: "Database of v1 reference files for the bowtie aligner. Can be generated with https://github.com/stjude/seaseq/blob/master/workflows/tasks/bowtie.wdl. [*.ebwt]" | ||
paired_end: "Is the data paired-end (true) or single-end (false)?" | ||
excludelist: "Optional list of regions that will be excluded after reference alignment" | ||
prefix: "Prefix for output files" | ||
validate_input: "Run Picard ValidateSamFile on the input BAM" | ||
|
@@ -43,6 +44,7 @@ workflow chipseq_standard { | |
Array[File] bowtie_indexes | ||
File? excludelist | ||
String prefix = basename(bam, ".bam") | ||
Boolean paired_end = false | ||
Boolean validate_input = true | ||
Boolean use_all_cores = false | ||
Int subsample_n_reads = -1 | ||
|
@@ -84,28 +86,36 @@ workflow chipseq_standard { | |
bam_index = samtools_index_input.bam_index, | ||
} | ||
|
||
scatter (pair in zip(bam_to_fastqs.read1s, get_read_groups.read_groups)){ | ||
scatter (tuple in zip( | ||
zip( | ||
bam_to_fastqs.read1s, | ||
bam_to_fastqs.read2s | ||
), | ||
get_read_groups.read_groups)){ | ||
call seaseq_util.basicfastqstats as basic_stats { input: | ||
fastqfile = pair.left | ||
fastqfile = tuple.left.left | ||
} | ||
call seaseq_map.mapping as bowtie_single_end_mapping { input: | ||
fastqfile = pair.left, | ||
#@ except: LineWidth | ||
call seaseq_map.mapping as bowtie_mapping { input: | ||
fastqfile = tuple.left.left, # the FASTQ pair is the left of the first pair, then it is R1 = left, R2 = right in the nested pair | ||
fastqfile_R2 = tuple.left.right, | ||
index_files = bowtie_indexes, | ||
metricsfile = basic_stats.metrics_out, | ||
blacklist = excludelist, | ||
paired_end, | ||
} | ||
File chosen_bam = select_first( | ||
[ | ||
bowtie_single_end_mapping.bklist_bam, | ||
bowtie_single_end_mapping.mkdup_bam, | ||
bowtie_single_end_mapping.sorted_bam, | ||
bowtie_mapping.bklist_bam, | ||
bowtie_mapping.mkdup_bam, | ||
bowtie_mapping.sorted_bam | ||
] | ||
) | ||
call util.add_to_bam_header { input: | ||
bam = chosen_bam, | ||
additional_header = pair.right, | ||
additional_header = tuple.right, | ||
} | ||
String rg_id_field = sub(sub(pair.right, ".*ID:", "ID:"), "\t.*", "") | ||
String rg_id_field = sub(sub(tuple.right, ".*ID:", "ID:"), "\t.*", "") | ||
String rg_id = sub(rg_id_field, "ID:", "") | ||
call samtools.addreplacerg as single_end { input: | ||
bam = add_to_bam_header.reheadered_bam, | ||
|
@@ -133,8 +143,19 @@ workflow chipseq_standard { | |
bam = markdup.mkdupbam, | ||
use_all_cores, | ||
} | ||
|
||
#@ except: UnusedCall | ||
call picard.validate_bam { input: bam = markdup.mkdupbam } | ||
call picard.validate_bam { input: | ||
bam = markdup.mkdupbam, | ||
ignore_list = [ | ||
"MISSING_PLATFORM_VALUE", | ||
"INVALID_PLATFORM_VALUE", | ||
"INVALID_MAPPING_QUALITY", | ||
"MATES_ARE_SAME_END", | ||
"MISMATCH_FLAG_MATE_NEG_STRAND", | ||
"MISMATCH_MATE_ALIGNMENT_START" | ||
Comment on lines
+151
to
+156
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The first two seem "ok" to ignore. Less comfortable ignoring the last four. Are all these still being produced by seaseq? |
||
], | ||
} | ||
|
||
call md5sum.compute_checksum { input: | ||
file = markdup.mkdupbam, | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename
single_end
to something elseThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
poke