NBISweden / AGAT

Another Gtf/Gff Analysis Toolkit
GNU General Public License v3.0
431 stars 52 forks source link

agat_sp_filter_feature_by_attribute_value.pl should be able to filter by multiple values #426

Closed Mitmischer closed 4 weeks ago

Mitmischer commented 4 months ago

Is your feature request related to a problem? Please describe. I have a set of genes and I want to filter the gff accordingly. agat_sp_filter_feature_by_attribute_value.pl only handles single comparisons so I could only filter one gene at a time.

Describe the solution you'd like value should accept multiple values.

Describe alternatives you've considered I could filter one gene at a time and then reassemble the file but that's cumbersome.

Juke34 commented 4 months ago

Could you provide an example of how you would like the command line to look like?

Juke34 commented 2 months ago

I do not get what you mean by " I could only filter one gene at a time" agat_sp_filter_feature_by_attribute_value.pl can filter all the genes in accordance with the value constraint you set on a selected attribute.

fuesseler commented 2 months ago

Hello! I think I ran into a similar problem as the OP with wanting to use mutliple values for this command.

I want to filter my GFF file according to multiple values of the attribute "gene_biotype", not just a single one. So, something like this (which did not work, no filtering happened): /usr/local/bin/agat_sp_filter_feature_by_attribute_value.pl --gff GCF_035594765.1_rAnoCar3.1.pri_genomic.agatfiltered.incomplgcm_pmstopcodons.gff -a gene_biotype --value lncRNA,rRNA,misc_RNA,tRNA,miRNA,snoRNA,ncRNA,snRNA,transcribed_pseudogene,V_segment --out GCF_035594765.1_rAnoCar3.1.pri_genomic.agatfiltered.agatfiltered_nopseudo.proteincoding.gff

Alternatively, a feature for "reverse" filtering (so keeping only the desired attribute and discarding all others) would also be nice. Then one could (in my example) filter for gene_biotype = proteincoding and discard the rest.

Only tangentially related, the Wiki https://agat.readthedocs.io/en/latest/tools/agat_sp_filter_feature_by_attribute_value.html still lists the command as "agat_sp_select_feature_by_attribute_value.pl" which caused me some confusion while trying to use it.

Juke34 commented 2 months ago

Thank you for your feedback @fuesseler ! Sounds doable

fuesseler commented 2 months ago

@Juke34 Awesome, looking forward to it :)