How to write gffutils.feature.Feature object to file

How to write gffutils.feature.Feature object to file

0

How do you most efficiently write a collection of gffutils.feature.Feature objects to file, so that you can create a gff3 file from a collection of Feature objects? I am trying to create a gff3 file without the ##FASTA part at the bottom, so I think I dont need the actual sequence records. Options I so far have are

  • Writing my own code, converting a Feature object to string. Have to take care with converting the attributes and all its items to an appropriate string representation
  • Converting gffutils.feature.Feature to Bio.SeqIO.SeqRecord objects, and using GFF.write() to create my file
  • I found some (old?) documentation that you could convert at Feature object to string by str(my_feature) or my_feature.str() or my_feature.to_string() but all those didnt work
my_feature = gffutils.feature.feature_from_line('contig_Atexampletexont1t100t.t+t.tName=seq_A')
str(my_feature)
my_feature.str()
my_feature.to_string()


gffutils


python


gff

• 9 views

Read more here: Source link