Skip to content

Instantly share code, notes, and snippets.

@finswimmer
Last active May 16, 2018 12:31
Show Gist options
  • Save finswimmer/783f18d979f20461653749a9b3c0362e to your computer and use it in GitHub Desktop.
Save finswimmer/783f18d979f20461653749a9b3c0362e to your computer and use it in GitHub Desktop.
Answer on biostar question 314928
from BCBio import GFF
in_file = "test.gff"
out_file = "test.parse.gff3"
limit_info = {
'gff_id': ["1"], # chromosome 1
'gff_type': ["ncRNA"] # get non coding RNA
}
with open(out_file, "w") as out_handle, open(in_file) as in_handle:
GFF.write(GFF.parse(in_handle, limit_info=limit_info), out_handle)
@finswimmer
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment