How do I convert a BAM file to SAM and GFF file to GTF for use in featurecount?
9 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2017 年 10 月 24 日
回答済み: Fulden Buyukozturk
2022 年 6 月 7 日
I would like to use the featurecount function in the Bioinformatics Toolbox. However it appears that it only accepts SAM and GTF files. My data is currently in a BAM and GFF files, which are nearly identical to SAM and GTF.
Is there any way to give these files to featurecount directly or to convert them using the Bioinformatics Toolbox? Doing this conversion directly through the Bioinformatics Toolbox would be convenient so that I don't have to manually do the work beforehand.
採用された回答
MathWorks Support Team
2017 年 10 月 24 日
The featurecount function currently only supports SAM and GTF files. The only workaround is to convert your files to these formats.
Using a BioMap object is currently the most straightforward way to convert from SAM to BAM using the Bioinformatics Toolbox.
b = BioMap('test.bam');
write(b,'test.sam','format','sam')
A direct conversion from GFF3 to GTF may not be possible without some simplifying assumptions, and there is currently no way to do this using the Bioinformatics Toolbox. Since GTF is identical to GFF2, you may be able to give the filename of a GFF2 file directly to featurecount.
If you have a third party conversion tool, you can call this tool from within MATLAB by using the ! character, as in this example.
if exist('test.sam') ~= 2
!thirdpartyconversiontool test.bam test.sam
end
if exist('test.gtf') ~= 2
!thirdpartyconversiontool test.gff test.gtf
end
0 件のコメント
その他の回答 (1 件)
Fulden Buyukozturk
2022 年 6 月 7 日
The featurecount function now accepts BAM files. GFF is not supported by featurecount, but the cuffgffread function can convert between GTF and GFF files.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Import についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!