Skip to content

Commit

Permalink
Bug fix: bad sequences included in ASM pattern result
Browse files Browse the repository at this point in the history
Take filtered sequences as ASM input. Update demo description and test data correspondingly.
  • Loading branch information
lancelothk committed Aug 11, 2018
1 parent 817c380 commit 934b9e4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
23 changes: 12 additions & 11 deletions BSPAT_standAlone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ Reference: [Hu, K., Ting, A. H., & Li, J. (2015). BSPAT: a fast online tool for

# 2.Prerequisite
* Java 1.8 or higher
* Bismark and its required softwares
* Bismark and its required softwares (e.g. python, samtools, bowtie2)

##2.1 install
Unzip BSPAT_standALone zip file. Executable files are under bin folder.

To add BSPAT to $PATH, [check here](http://askubuntu.com/questions/109381/how-to-add-path-of-a-program-to-path-environment-variable)

# 3.Demo
Following demo is tested with bowtie2-2.3.4.2-linux-x86_64, Bismark_v0.19.1, samtools1.6
[Download demo data](demo.zip)

Demo folder structure:
Expand Down Expand Up @@ -69,28 +70,28 @@ After execution, demo folder looks like:

## 3.2 BSPAT
```
>BSPAT ref demoSequence.fastq_bismark.bam target.bed
>BSPAT ref demoSequence_bismark_bt2.bam target.bed
```
Result files are:
```
.
├── demo-31-99-test_bismark.analysis_ASM.txt
├── demo-31-99-test_bismark.analysis_Methylation.txt
├── demo-31-99-test_bismark.analysis_MethylationWithSNP.txt
├── demo-31-99-test_bismark.analysis_report.txt
├── demo-31-99-test_bismark.analysis.txt
├── demo-31-99-test-plus_bismark.analysis_ASM.txt
├── demo-31-99-test-plus_bismark.analysis_Methylation.txt
├── demo-31-99-test-plus_bismark.analysis_MethylationWithSNP.txt
├── demo-31-99-test-plus_bismark.analysis_report.txt
├── demo-31-99-test-plus_bismark.analysis.txt
```
## 3.3 BSPAT_figure
```
>BSPAT_figure demo-31-99-test_bismark.analysis_Methylation.txt demo-31-99-test_bismark.analysis_report.txt
>BSPAT_figure demo-31-99-test_bismark.analysis_ASM.txt -a
>BSPAT_figure demo-31-99-test-plus_bismark.analysis_Methylation.txt demo-31-99-test-plus_bismark.analysis_report.txt
>BSPAT_figure demo-31-99-test-plus_bismark.analysis_ASM.txt -a
```
Result files are:
```
.
├── demo-31-99-test_bismark.analysis_ASM.png
├── demo-31-99-test_bismark.analysis_Methylation.png
├── demo-31-99-test_bismark-plus.analysis_ASM.png
├── demo-31-99-test_bismark-plus.analysis_Methylation.png
```

# 4.Interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,13 @@ private static void generatePatternsSingleGroup(String outputPath, double bisulf
Pair<List<Sequence>, List<Sequence>> qualityFilterSequencePair = filterSequences(
seqGroup, bisulfiteConversionRate, sequenceIdentityThreshold);

List<Sequence> sequenceNotPassedQualityFilter = qualityFilterSequencePair.getRight();
System.out.printf("%d unqualified sequences are filtered.\n", sequenceNotPassedQualityFilter.size());
IOUtils.writeAnalysedSequences(outputPath + "/" + targetRegion.toString() + "_bismark.analysis.filtered.txt",
sequenceNotPassedQualityFilter, refSeq.length(), targetRegion.isMinusStrand());

List<Sequence> sequencePassedQualityFilter = qualityFilterSequencePair.getLeft();
System.out.printf("%d qualified sequences are included in result.\n", sequencePassedQualityFilter.size());
IOUtils.writeAnalysedSequences(outputPath + "/" + targetRegion.toString() + "_bismark.analysis.txt",
sequencePassedQualityFilter, refSeq.length(), targetRegion.isMinusStrand());

Expand Down Expand Up @@ -212,7 +218,7 @@ private static void generatePatternsSingleGroup(String outputPath, double bisulf
Pattern.METHYLATIONWITHSNP),
targetRefSeq, meMuPatternList, Pattern.METHYLATIONWITHSNP, sequencePassedQualityFilter.size());

Pair<Pattern, Pattern> allelePatterns = getAllelePatterns(seqGroup, potentialSNP);
Pair<Pattern, Pattern> allelePatterns = getAllelePatterns(sequencePassedQualityFilter, potentialSNP);
Pattern allelePattern = allelePatterns.getLeft();
Pattern nonAllelePattern = allelePatterns.getRight();
if (allelePattern.getCount() != 0 && nonAllelePattern.getCount() != 0) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ASM count percentage
TCTCTAATGAGGGAGGAGGCCCGAGGATGGCTGGGTTTGATTTATGACTGGAGGAGAAGGTCCACTTCCCACTGCGAAGCAGGCGAC ref
---------------------**---------------------------------------------------**-------**-- 417 0.5291878172588832
---------------------@@---------------------------------------------------@@-------@A-- 371 0.47081218274111675
---------------------**---------------------------------------------------**-------**-- 410 0.5203045685279187
---------------------@@---------------------------------------------------@@-------@A-- 356 0.4517766497461929
Methylation level in reads with reference allele:
Relative_CpG_position Methyl_Level
21 0.08173076923076923
74 0.9206730769230769
83 0.7718446601941747
21 0.08068459657701711
74 0.921760391198044
83 0.7728395061728395
Methylation level in reads with alternative allele:
Relative_CpG_position Methyl_Level
21 0.0972972972972973
74 0.16172506738544473
83 0.02981029810298103
21 0.09859154929577464
74 0.1601123595505618
83 0.022598870056497175

0 comments on commit 934b9e4

Please sign in to comment.