基因组基因组组装

gff格式与gtf格式转换——gffread

2022-01-17  本文已影响0人  Wei_Sun

gff和gtf格式都可以储存基因信息,但是不同的软件对于文件格式的要求不同。

关于gff文件和gtf格式的详细介绍,可以参见生信技能树,简单的区别对比见下表。
http://www.biotrainee.com/thread-2705-1-1.html

有时gff和gtf需要转换,本篇本章主要介绍gffread。gffread是Cufflinks的子功能,Cufflinks程序从RNA-Seq数据中组装转录组,并量化它们的表达。

Cufflinks官网:
http://cole-trapnell-lab.github.io/cufflinks/

说明书:
https://github.com/cole-trapnell-lab/cufflinks/blob/master/README.md

1.下载安装

1.1 依赖环境

1.1.1 Boost
bjam --prefix=<YOUR_BOOST_INSTALL_DIRECTORY> --toolset=darwin architecture=x86 address_model=32_64 link=static runtime-link=static --layout=versioned stage install
bjam --prefix=<YOUR_BOOST_INSTALL_DIRECTORY> --toolset=gcc architecture=x86 address_model=32 link=static runtime-link=static stage install
bjam --prefix=<YOUR_BOOST_INSTALL_DIRECTORY> --toolset=gcc architecture=x86 address_model=64 link=static runtime-link=static stage install
1.1.2 SAM tools

http://samtools.sourceforge.net/

1.1.3 Eigen libraries

https://eigen.tuxfamily.org/index.php?title=Main_Page

1.2 下载

选择合适的版本下载压缩包,下载地址:
http://cole-trapnell-lab.github.io/cufflinks/install/

1.3 安装

$ tar xvf cufflinks-2.2.1.Linux_x86_64.tar.gz

1.4 检测

$ cd ~/cufflinks-2.2.1.Linux_x86_64
$ gffread -h

1.5 添加环境变量

$ vim ~/.bashrc
  export PATH= ~/cufflinks-2.2.1.Linux_x86_64:$PATH
$ source ~/.bashrc

2.gffread功能

说明书:
http://ccb.jhu.edu/software/stringtie/gff.shtml#gffread

2.1 gff转gtf

$ gffread -T CE10g_v2.0.gff3  -o CE10g_v2.0.gtf

2.2 对gtf文件快速检查

$ gffread -E CE10g_v2.0.gtf -o- | less

2.3 对gff文件快速检查

$ gffread -E CE10g_v2.0.gff3 -T -o- | more

2.4 评估转录本发现的准确性

$ gffread -w transcripts.fa -g /path/to/genome.fa transcripts.gtf

2.5 gtf转gff

$ gffread -L CE10g_v2.0.gtf  -o v2.0.gff

2.6 查看gffread具体参数

$ gffread -h
Usage:
gffread <input_gff> [-g <genomic_seqs_fasta> | <dir>][-s <seq_info.fsize>]
 [-o <outfile.gff>] [-t <tname>] [-r [[<strand>]<chr>:]<start>..<end> [-R]]
 [-CTVNJMKQAFGUBHZWTOLE] [-w <exons.fa>] [-x <cds.fa>] [-y <tr_cds.fa>]
 [-i <maxintron>]
 Filters and/or converts GFF3/GTF2 records.
 <input_gff> is a GFF file, use '-' if the GFF records will be given at stdin

 Options:
  -g  full path to a multi-fasta file with the genomic sequences
      for all input mappings, OR a directory with single-fasta files
      (one per genomic sequence, with file names matching sequence names)
  -s  <seq_info.fsize> is a tab-delimited file providing this info
      for each of the mapped sequences:
      <seq-name> <seq-length> <seq-description>
      (useful for -A option with mRNA/EST/protein mappings)
  -i  discard transcripts having an intron larger than <maxintron>
  -r  only show transcripts overlapping coordinate range <start>..<end>
      (on chromosome/contig <chr>, strand <strand> if provided)
  -R  for -r option, discard all transcripts that are not fully
      contained within the given range
  -U  discard single-exon transcripts
  -C  coding only: discard mRNAs that have no CDS feature
  -F  full GFF attribute preservation (all attributes are shown)
  -G  only parse additional exon attributes from the first exon
      and move them to the mRNA level (useful for GTF input)
  -A  use the description field from <seq_info.fsize> and add it
      as the value for a 'descr' attribute to the GFF record

  -O  process also non-transcript GFF records (by default non-transcript
      records are ignored)
  -V  discard any mRNAs with CDS having in-frame stop codons
  -H  for -V option, check and adjust the starting CDS phase
      if the original phase leads to a translation with an
      in-frame stop codon
  -B  for -V option, single-exon transcripts are also checked on the
      opposite strand
  -N  discard multi-exon mRNAs that have any intron with a non-canonical
      splice site consensus (i.e. not GT-AG, GC-AG or AT-AC)
  -J  discard any mRNAs that either lack initial START codon
      or the terminal STOP codon, or have an in-frame stop codon
      (only print mRNAs with a fulll, valid CDS)
  --no-pseudo: filter out records matching the 'pseudo' keyword

  -M/--merge : cluster the input transcripts into loci, collapsing matching
       transcripts (those with the same exact introns and fully contained)
  -d <dupinfo> : for -M option, write collapsing info to file <dupinfo>
  --cluster-only: same as --merge but without collapsing matching transcripts
  -K  for -M option: also collapse shorter, fully contained transcripts
      with fewer introns than the container
  -Q  for -M option, remove the containment restriction:
      (multi-exon transcripts will be collapsed if just their introns match,
      while single-exon transcripts can partially overlap (80%))

  --force-exons: make sure that the lowest level GFF features are printed as
      "exon" features
  -E  expose (warn about) duplicate transcript IDs and other potential
      problems with the given GFF/GTF records
  -D  decode url encoded characters within attributes
  -Z  merge close exons into a single exon (for intron size<4)
  -w  write a fasta file with spliced exons for each GFF transcript
  -x  write a fasta file with spliced CDS for each GFF transcript
  -W  for -w and -x options, also write for each fasta record the exon
      coordinates projected onto the spliced sequence
  -y  write a protein fasta file with the translation of CDS for each record
  -L  Ensembl GTF to GFF3 conversion (implies -F; should be used with -m)
  -m  <chr_replace> is a reference (genomic) sequence replacement table with
      this format:
      <original_ref_ID> <new_ref_ID>
      GFF records on reference sequences that are not found among the
      <original_ref_ID> entries in this file will be filtered out
  -o  the "filtered" GFF records will be written to <outfile.gff>
      (use -o- for printing to stdout)
  -t  use <trackname> in the second column of each GFF output line
  -T  -o option will output GTF format instead of GFF3

引用转载请注明出处,如有错误敬请指出。

上一篇下一篇

猜你喜欢

热点阅读