Thank you very much! I have tried that but I am still trying to make it work. It outputs an error which looks like this:
Traceback (most recent call last):
File "pysam.py", line 1, in <module>
import pysam
File "/home/ofelia/Documents/Sequences hard drive/Seqeuences/pysam.py", line 2, in <module>
bamfile = pysam.AlignmentFile("mapped.bam")
AttributeError: module 'pysam' has no attribute 'AlignmentFile'
I have read online and it should be sth with the versions but it is the same as on their website: pysam website.
Do your bam also contain unmapped reads? What is the organism and type of sequencing / library? There are a number of reasons which could account for this pattern, and knowing the above information would help provide more accurate / direct solutions to your problem.
As for your question, you can do this with reformat.sh from BBTools / BBMap:
Adjust
mingcandmaxgcas needed.Thank you very much. I first extracted mapped reads from the sorted bam file (that came from bowtie) and I added the mapped reads to the FASTQC and I still have a peak of around 55%GC content. I am working on Dictyostelium discoideum which is very AT rich (27% GC content) and the sequencing was done on DNA. I should also say that even in the sequences that map really well (>90%) I see the same pattern. I am interested to see where are located and maybe if they are the same between strains. This is a link to the image I get image