Comments (6)
Hi,
Have you solved this problem? I have the same issue when using LACHESIS. I am wondering how to solved this problem. Could you please provide any clue about this?
Thanks!
from lachesis.
Hi,
I remembered the problem was result from un-sorted bam. Maybe it is a problem of SortSam.jar in picard (so I change it to SortSame). Or you had to sort the bam before the step of "samtools flagstat" (I had a new file called *consistent.bam). It's a long time since I solve this problem and I couldn't get the files. So I would give the relate code that was used to revised the file of PreprocessSAMs.pl blow, Hope it would help.
By the way, you could sorted bam file before "samtools flagstat", then continue the following process if it failed without repeat the previously steps.
export reSite="AAGCTT"
export bedtoolsPath="/tools/bedtools2-2.20.1/bin/bedtools"
export samtoolsPath="/tools/samtools-0.1.19/samtools"
export picardPath="/tools/picard/picard.jar"
export memSize="64G"
export filterInconsistentPath="/tools/NGS/bin/filterInconsistentPairReads.pl"
sed -i "/^my \$RE_site/s#'.*'#'$reSite'#; \
/^my \$make_bed_around_RE_site_pl/s#'.*'#'$outputDir/preprocessSAMs/make_bed_around_RE_site.pl'#; \
/^my \$bedtools/s#'.*'#'$bedtoolsPath'#; \
/^my \$samtools/s#'.*'#'$samtoolsPath'#; \
/^#my \$mem/s#\".*\"#\"$memSize\"#;/^#my \$mem/s/#//;
/^#my \$picard_head/s#\/.*\/#$picardPath#;/^#my \$picard_head/s/#//;
/#run_cmd( \"\${picard_head}SortSam.jar/s/SortSam.jar/ SortSam/;
/#run_cmd( \"\${picard_head} SortSam/s/^#//;
/#run_cmd( \"\${picard_head}MarkDuplicates.jar/s/MarkDuplicates.jar/ MarkDuplicates/;
/#run_cmd( \"\${picard_head} MarkDuplicates/s/^#//;
/run_cmd( \"\${picard_head} MarkDuplicates/s#true\"#true READ_NAME_REGEX=null TMP_DIR=$outputDir/preprocessSAMs/temp MAX_FILE_HANDLES_FOR_READ_ENDS_MAP=1000\"#;
/^my $nodups/s#\"\"#\".nodups\"#;
/run_cmd( \"\$samtools view -F12/a run_cmd( \"\$filterInconsistentPath \$head.REduced\$nodups.paired_only.bam | \$samtools view -bS - -o \$head.consistent.bam\" );
/run_cmd( \"\$samtools flagstat/s#\$head.REduced.*flagstat#\$head.consistent.bam > \$head.consistent.flagstat#;
/^\/\//s#^//#\#//#" PreprocessSAMs.pl
sed -i "/^my \$samtools/a my \$filterInconsistentPath = '$filterInconsistentPath';" PreprocessSAMs.pl
sed -i "/^\/\//s#^//#\#//#" make_bed_around_RE_site.pl
from lachesis.
Hi, Thanks for your message.
I will try to solve this problem with your script :-)
from lachesis.
Hi,
I remembered the problem was result from un-sorted bam. Maybe it is a problem of SortSam.jar in picard (so I change it to SortSame). Or you had to sort the bam before the step of "samtools flagstat" (I had a new file called *consistent.bam). It's a long time since I solve this problem and I couldn't get the files. So I would give the relate code that was used to revised the file of PreprocessSAMs.pl blow, Hope it would help.
By the way, you could sorted bam file before "samtools flagstat", then continue the following process if it failed without repeat the previously steps.
export reSite="AAGCTT" export bedtoolsPath="/tools/bedtools2-2.20.1/bin/bedtools" export samtoolsPath="/tools/samtools-0.1.19/samtools" export picardPath="/tools/picard/picard.jar" export memSize="64G" export filterInconsistentPath="/tools/NGS/bin/filterInconsistentPairReads.pl" sed -i "/^my \$RE_site/s#'.*'#'$reSite'#; \ /^my \$make_bed_around_RE_site_pl/s#'.*'#'$outputDir/preprocessSAMs/make_bed_around_RE_site.pl'#; \ /^my \$bedtools/s#'.*'#'$bedtoolsPath'#; \ /^my \$samtools/s#'.*'#'$samtoolsPath'#; \ /^#my \$mem/s#\".*\"#\"$memSize\"#;/^#my \$mem/s/#//; /^#my \$picard_head/s#\/.*\/#$picardPath#;/^#my \$picard_head/s/#//; /#run_cmd( \"\${picard_head}SortSam.jar/s/SortSam.jar/ SortSam/; /#run_cmd( \"\${picard_head} SortSam/s/^#//; /#run_cmd( \"\${picard_head}MarkDuplicates.jar/s/MarkDuplicates.jar/ MarkDuplicates/; /#run_cmd( \"\${picard_head} MarkDuplicates/s/^#//; /run_cmd( \"\${picard_head} MarkDuplicates/s#true\"#true READ_NAME_REGEX=null TMP_DIR=$outputDir/preprocessSAMs/temp MAX_FILE_HANDLES_FOR_READ_ENDS_MAP=1000\"#; /^my $nodups/s#\"\"#\".nodups\"#; /run_cmd( \"\$samtools view -F12/a run_cmd( \"\$filterInconsistentPath \$head.REduced\$nodups.paired_only.bam | \$samtools view -bS - -o \$head.consistent.bam\" ); /run_cmd( \"\$samtools flagstat/s#\$head.REduced.*flagstat#\$head.consistent.bam > \$head.consistent.flagstat#; /^\/\//s#^//#\#//#" PreprocessSAMs.pl sed -i "/^my \$samtools/a my \$filterInconsistentPath = '$filterInconsistentPath';" PreprocessSAMs.pl sed -i "/^\/\//s#^//#\#//#" make_bed_around_RE_site.pl
Hi,@lamz138138,
I got the same problem, and i try to sovle the problem by using your code. I have a question about where can i get the script of filterInconsistentPairReads.pl? Is this problem caused by not sorting the sam file ? I am wondering how to solved this problem. Could you please provide any clue about this?
Thanks!
from lachesis.
@Epigenetics-Wang Hi, I remember it was caused by failing to sort the bam, that is the output bam isn't sorted by name as expected. And I think filterInconsistentPairReads.pl is my script, but I forget what is used for (it's a pity I can't find this scripts now).
I had solved this problem by running the PrepocessSAMs.pl step by step, then figure out whether bam is sorted by name. Then if it still failed to work, try to find read that make "c2.tid == c1.mtid" is false (read name is different which may result from failing to sort bam), then write filterInconsistentPairReads.pl.
Hope this useful.
from lachesis.
@Epigenetics-Wang Hi, I remember it was caused by failing to sort the bam, that is the output bam isn't sorted by name as expected. And I think filterInconsistentPairReads.pl is my script, but I forget what is used for (it's a pity I can't find this scripts now).
I had solved this problem by running the PrepocessSAMs.pl step by step, then figure out whether bam is sorted by name. Then if it still failed to work, try to find read that make "c2.tid == c1.mtid" is false (read name is different which may result from failing to sort bam), then write filterInconsistentPairReads.pl.
Hope this useful.
Hi,@lamz138138,
Thanks for your message.
I will try to solve this problem with your advice :-)
from lachesis.
Related Issues (20)
- Bareword found where operator expected at PreprocessSAMs.pl HOT 1
- error
- error: Assertion `c1.pos == c2.mpos' failed HOT 4
- Segmentation fault (core dumped) using reference HOT 2
- How to get chromosome bins HOT 6
- bam/sam.h HOT 7
- Error in grid.newpage() : could not open file 'out/HiC_heatmap.jpg' HOT 1
- errors about SAMStepper.cc and SAMStepper.h in sam.h
- checking for library containing deflate... no HOT 1
- samtools-0.1.18 boost_1_52_0 HOT 1
- configuration ERROR with samtools HOT 3
- cluster number is not equal with what I know
- significant clusters but no contigs oriented
- Error for ordering step
- Error in force(filename) : object 'jpeg.file' not found
- void LoadDeNovoCLMsFromSAM
- Lachesis: GenomeLinkMatrix.cc:1133: void GenomeLinkMatrix::ValidateClusters(const TrueMapping*, bool) const: Assertion `( same_cluster ? N_links_same_cluster : N_links_diff_cluster ) HOT 1
- samtools error HOT 1
- compile fail int64_t declaration without type. HOT 1
- checking for sam_open in -lbam... no
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 lachesis.