Comments (6)
By @GWarsow:
Conversion to cram files requires aligned and sorted sam/bam files.
During the generation of the final sorted/merged/duplicate-marked bam file, it makes no sense to format to cram.
Hence, we stay with bam format for the alignment, sorting, duplicate-tagging and merging (nothing changes in bwaMemSortSlim.sh)
After merging and duplicate-marking, we could think of going to cram.
But as we already have the sam/bam stream available after starting from fastq files, we can use them for downstream analyses.
Important to state: We should avoid writing bam files to HD and write only the cram file instead.
Concludingly, the alignment/QC workflow does not have to switch to cram but only has to create a cram file as last step.
from alignmentandqcworkflows.
By @GWarsow:
Things may get more complicated when the merged cram file already exists and new lanes shall be added to it.
samtools view will correctly give back singlebams that are already inside the cram file.
In order to contue using the script alreadyMergedLane.pl, the parameter pairedBamSuffix has to be adapted ( e.g. "_paired.bam.sorted.bam" --> "_paired.bam.sorted.cram") or pairedCramSuffix has to be introduced.
from alignmentandqcworkflows.
By @GWarsow:
Now lets look at marking duplicates. As a first step, we will skip the Picard-based block and concentrate on the biobambam block.
If the cram file already exists, we have to fill the QC NPs with BAM content (and SAM content for NP_COMBINEDANALYSIS_IN.
This can be achieved with cramtools/samtools. But we have to see, whether this works out well with regard to performance. Obviously, just performing a cat on the bam file will not suffice when we have a cram file.
First implementation is like
cat ${FILENAME} | ${CRAM2BAM_TARGET} | tee ${NP_FLAGSTATS_IN}...
from alignmentandqcworkflows.
By @GWarsow:
Picard-based blocks still have to be adapted...
from alignmentandqcworkflows.
See https://eilslabs-phabricator.dkfz.de/T280 for more details.
from alignmentandqcworkflows.
CRAM generation should use samtools, which is lossless by default. The way to go for completely lossless production and restoring CRAM is then probably
# cram->bam
samtools view -O cram,store_md=1,store_nm=1 -o aln.cram aln.bam
# bam->cram
samtools view --input-fmt cram,decode_md=0 -o aln.new.bam aln.cram
This will even store and restore the NM and MD tags.
An index will have to be build separately, like with bam by
samtools index aln.cram aln.crai
(see samtools man-page).
from alignmentandqcworkflows.
Related Issues (20)
- Process data from object storage
- Add for-loop to waitForRegisteredPids
- Switch PID registry to associative array
- Move Bash library code to DefaultPlugin or own repo HOT 1
- Add collected ambiguously classified undirected WGBS reads in QC-JSON
- Allow setting the number of bases at read start that should should be ignored for conversion statistics
- Merge without duplication marking
- Better IO checks in Perl scripts
- Tagmentation WGS and WES
- Calculate target region size from TARGET_REGION_FILE
- _de novo_ adapter detection HOT 1
- Lift methylation meta job to WFMS level
- Filename length restriction in R diffchrom script HOT 2
- Check wait -n for task management in bash code
- bwa-mem2 support
- Move fingerprinting into pipeline
- Add bwa-postalt.js to WGBS bwa job
- Remove the biobambam sort option
- Get fingerprinting to work with ALT-contig reference
- `.DepthOfCoverage_Target.txt` has odd output
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alignmentandqcworkflows.