I have some bam files of RNAseq data, and I want to calculate the FPKM values of each gene. However, I couldn't know how the bam files are generated. I tried to use cufflinks to do this, but the corresponding values are weird. Is there any suggestions to me? I'm sorry that I'm new to this field.
Are you sure you can not determine how the BAM files were generated? One of the conventions of a BAM file is that it contains the command used to generate it. The command is stored in the file header, and can be seen with:
samtools view -H yourFile.bam
One of the last lines of the header should llok something like:
@PG ID:TopHat VN:2.0.13 CL:/n/local/bin/tophat --GTF SacCer3.gtf --library-type fr-firststrand ...etc.
Occasionally some BAM files will not contain this information. You should confirm that your files do not have it.
Cufflinks should calculate FPKM values for you. But as Geek_y mentions, saying the values are "wierd" is uninformative. You'll have to say exactly what you mean. You can try calculating some values by hand - you can use samtools to pull out reads covering a given gene (see samtools view), count them, and manually calculate the FPKM using the total number of mapped reads returned by samtools idxstats to see if things are making sense. You could also examine some of the read flags to see if the alignment was done using parameters you don't agree with (i.e. examine map quality, number of hits etc.).
Lastly, if you simply want to remap everything yourself, but all you have are the BAM files, you can convert them back to fastq, and map them to your liking:
bedtools bamtofastq -i input.bam -fq output.fq
I would not use cufflinks to do this. First you need to generate your count table, which you can do using HTseq-count, then take a look at this post ( How To Calculate The Rpkm For The Count Tables Of Rna Seq Data ) to calculate the FPKM values yourself using the .gtf file you listed above. One question though, if you don't know how the BAM file was created, then how do you know it was aligned to Hg19? It might be helpful to post the BAM file header here so others can see what your looking at.