BSSeeker / BSseeker2

A versatile aligning pipeline for bisulfite sequencing data
http://pellegrini.mcdb.ucla.edu/BS_Seeker2/
MIT License
60 stars 25 forks source link

bs_seeker2-call_methylation.py has error with merged bam file #4

Closed hmkim closed 7 years ago

hmkim commented 8 years ago

check this issue.

When I run the calling program in bs_seeker2 (bs_seeker2-call_methylation.py) with my bam file (all chromosome), I got the error.

TypeError: string indices must be integers

I check the pr.query_position (variable) and I found the the value is None. so, I change the code.

Could you confirm this solution or any other solution?

2015-11-10 08 19 57
BSSeeker commented 8 years ago

@hmkim Is this error for all the reads, or only for some reads? What's your pysam version? Thanks.

hmkim commented 8 years ago

pysam version is 0.8.3

Well, This error is for some reads.

Sorry for my late reply.

guoweilong commented 8 years ago

Hello,

It seems a pysam version problem. As many people reported our original version did not support new pysam, I updated this, but it seems your version still not work well. May I know the version of your pysam?

Best, Weilong

At 2015-12-29 14:19:27, "alena54" notifications@github.com wrote:

Hi, When i'm running bs_seeker2-call_methylation.py(see below the sh file),i'm getting error.Can you please rectify the error.

Methylation_call.sh python2.7 bs_seeker2-call_methylation.py -i /BS-Seeker_align.bam -o Methylation_call --db /BSseeker2master/bs_utils/reference_genomes/Homo_sapiens.GRCh37.75.dna.toplevel.fa_bowtie2

Error Msg: BS-Seeker2 v2.0.8 - Sept 5, 2014 [2015-12-23 12:40:17] sorting BS-Seeker alignments [2015-12-23 13:12:02] indexing sorted alignments [2015-12-23 13:14:46] calculating methylation levels [2015-12-23 13:14:57] Processing chromosome: 1 Traceback (most recent call last): File "bs_seeker2-call_methylation.py", line 267, in read_nuc = pr_alignment.seq[pr.query_position] TypeError: string indices must be integers, not NoneType.

Thank you so much for the time and consideration.

— Reply to this email directly or view it on GitHub.

BSSeeker commented 8 years ago

@alena54 I just updated the call_methylation as suggested by @hmkim. Can you updated your local version, and see if it works?

guoweilong commented 8 years ago

Hello,

I might not clear in last email.

Could you just replace the new bs_seeker2-call_methylation.py from the github? And DO NOT change the code any more. I thought it was the version problem, but from @hmkim, it seems a problem with new version of pysam.

So please change the code back to:

if pysam.__version__ >"0.8.0" :

And do NOT change ti to:

if pysam.__version__ >"0.8.3" :

Best, Weilong

Integrated Science Building 538 Peking University, 100871 Beijing, China Homepage: http://guoweilong.github.io/

At 2015-12-30 13:12:10, "alena54" notifications@github.com wrote: Hi , Thank you so much. I have changed the code as you said but again other error generated.

Traceback (most recent call last): File "bs_seeker2-call_methylation.py", line 233, in pr_qpos =pr.qpos AttributeError: 'pysam.calignmentfile.PileupRead' object has no attribute 'qpos'

Thanks alot

On Tue, Dec 29, 2015 at 7:15 PM, BSSeeker notifications@github.com wrote:

@alena54 https://github.com/alena54 I just updated the call_methylation as suggested by @hmkim https://github.com/hmkim. Can you updated your local version, and see if it works?

— Reply to this email directly or view it on GitHub https://github.com/BSSeeker/BSseeker2/issues/4#issuecomment-167793718.

— Reply to this email directly or view it on GitHub.

alena54 commented 8 years ago

Hi,

During Alignment steps, In Output no. of cycles are shown and i guess it varies on size of file or bases.can you please tell me in what basis the cycles are counted.if you could a brief explanation about it. For example:i ran three sample data and in that in one it ran 17 cycles ,second 15 cycles and third 275 cycles.Please guide me. Thank you for time and consideration.

On Wed, Jan 13, 2016 at 11:57 AM, veena G vnapillai54@gmail.com wrote:

Hi

Sorry for the late reply. Now it working fine and got the result for methylation_call. Thanks.

On Wed, Dec 30, 2015 at 11:29 AM, veena G vnapillai54@gmail.com wrote:

Hi

Ya sure i will replace the new bs_seeker2-call_methylation.py from the github. Thank you so much.

On Wed, Dec 30, 2015 at 10:56 AM, Weilong Guo notifications@github.com wrote:

Hello,

I might not clear in last email.

Could you just replace the new bs_seeker2-call_methylation.py from the github? And DO NOT change the code any more. I thought it was the version problem, but from @hmkim, it seems a problem with new version of pysam.

So please change the code back to:

if pysam.version >"0.8.0" :

And do NOT change ti to:

if pysam.version >"0.8.3" :

Best, Weilong

Integrated Science Building 538 Peking University, 100871 Beijing, China Homepage: http://guoweilong.github.io/

At 2015-12-30 13:12:10, "alena54" notifications@github.com wrote: Hi , Thank you so much. I have changed the code as you said but again other error generated.

Traceback (most recent call last): File "bs_seeker2-call_methylation.py", line 233, in pr_qpos =pr.qpos AttributeError: 'pysam.calignmentfile.PileupRead' object has no attribute 'qpos'

Thanks alot

On Tue, Dec 29, 2015 at 7:15 PM, BSSeeker notifications@github.com wrote:

@alena54 https://github.com/alena54 I just updated the call_methylation as suggested by @hmkim https://github.com/hmkim. Can you updated your local version, and see if it works?

— Reply to this email directly or view it on GitHub <https://github.com/BSSeeker/BSseeker2/issues/4#issuecomment-167793718 .

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/BSSeeker/BSseeker2/issues/4#issuecomment-167939459.

guoweilong commented 7 years ago

@alena54 Hi, sorry just noticed your lastest comment.

The cycle indicate the "cycle" during Illumina sequencing, corresponding to number of base in your sequenced reads.

If your read is 150bp SE, then -s 11 -e 140 would cut 10bp from both 5' and 3' ends.

Weilong