Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing GFF_FEATURE #174

Open
jfouret opened this issue Mar 13, 2024 · 0 comments
Open

Parsing GFF_FEATURE #174

jfouret opened this issue Mar 13, 2024 · 0 comments

Comments

@jfouret
Copy link

jfouret commented Mar 13, 2024

Hi,

First, thank you for this tool. I may report a small bug, not really a bug though. The parsing of the "gene" feature seems not to be functional as intended originally.
Anyway if we have an ID field, all is good at the end but see below the code to understand what I mean:

PS: It would be good to precise hos the GFF_FEATURE is parsed from the GFF file in the documentation.

You are using the following code:

  std::vector<gff3_feature>::iterator it;
  char *ref_codon, *alt_codon;
  for (it = features.begin(); it != features.end(); it++) {
    fout << line_stream.str();
    // add in gene level info, control for case it's not present
    std::string gene = it->get_attribute("gene");
    if (gene.empty()) {
      fout << it->get_attribute("ID") << "\t";
    } else {
      fout << gene + ":" + it->get_attribute("ID") << "\t";
    }

Why is it not:

  std::vector<gff3_feature>::iterator it;
  char *ref_codon, *alt_codon;
  for (it = features.begin(); it != features.end(); it++) {
    fout << line_stream.str();
    // add in gene level info, control for case it's not present
    std::string gene = it->get_attribute("gene");
    if (gene.empty()) {
      fout << it->get_attribute("ID") << "\t";
    } else {
      fout << gene + ":" + gene << "\t";
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant