Comments (4)
Hi, I think a good alternative way is to derive needed metrics using a small python script, it is fast and easy, such as:
for sample, task in bamdst_task_dict.items():
stat_file = os.path.join(task.wkdir, task.outputs['coverage_report'].value)
depth_file = os.path.join(task.wkdir, task.outputs['depth_file'].value)
with open(stat_file) as f:
target_info = dict()
for line in f:
if line.startswith('#'):
continue
name, value = line.strip().split('\t')
if '%' in value:
value = round(float(value.replace('%', ''))*0.01, 4)
else:
value = float(value)
target_info[name] = value
# 计算均一性
data = pd.read_table(depth_file, header=0, low_memory=False)
mean_coverage = data['Cover depth'].mean()
target_info['[Target] Coverage (>=0.2*MeanDepth)'] = sum(data['Cover depth'] >= mean_coverage*0.2)/data.shape[0]
target_info['[Target] Coverage (>=0.5*MeanDepth)'] = sum(data['Cover depth'] >= mean_coverage*0.5)/data.shape[0]
target_info['[Target] Coverage (>=200x)'] = sum(data['Cover depth'] >= 200)/data.shape[0]
target_info['[Target] Coverage (>=300x)'] = sum(data['Cover depth'] >= 300)/data.shape[0]
target_info['[Target] Coverage (>=500x)'] = sum(data['Cover depth'] >= 500)/data.shape[0]
target_info['[Target] Coverage (>=1000x)'] = sum(data['Cover depth'] >= 1000)/data.shape[0]
target_info['[Target] Coverage (>=2000x)'] = sum(data['Cover depth'] > 2000)/data.shape[0]
target_info['[Target] Coverage (>=5000x)'] = sum(data['Cover depth'] > 5000)/data.shape[0]
target_info['[Target] Coverage (>=10000x)'] = sum(data['Cover depth'] > 10000)/data.shape[0]
from bamdst.
The similar question has been reported here #3. I have added this requestion in my todo list. And I will close this issue after update.
from bamdst.
Thanks!
from bamdst.
now support, thanks to @biolxy
from bamdst.
Related Issues (20)
- 请问使用您的软件,如何引用? HOT 1
- what should i do? HOT 1
- Segmentation fault (core dumped) HOT 9
- multithreading support HOT 1
- make error HOT 1
- @@ ERROR ABORT @@ bam files are not properly sorted HOT 2
- Suggestion - making a bioconda recipe HOT 1
- make warning
- error 404 Issue installing private repos with devtools HOT 1
- how to accelerate the software bamdst
- Segmentation fault (core dumped) HOT 3
- Multi-genomes HOT 5
- How to change the name of output file HOT 1
- [Target] Coverage (>0x) 100.00% but uncover.bed is not umpty HOT 1
- Coverage difference between bamdst and gatk DepthOfCoverage HOT 1
- AMP data whitout rmdup but different HOT 2
- question about long reads HOT 3
- about the depth.tsv.gz HOT 4
- Error ocurrus when use bamdst to stat WGS bam file HOT 7
- I'd like to know bamdst how to handle overlapping pair-end reads
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 bamdst.