miRTop / mirtop

command lines tool to annotate miRNAs with a standard mirna/isomir naming
https://mirtop.readthedocs.org
MIT License
18 stars 21 forks source link

Add column to name the file during `stats` sub-command #18

Open lpantano opened 6 years ago

lpantano commented 6 years ago

For that, it has to be implemented code at https://github.com/miRTop/mirtop/blob/dev/mirtop/gff/stats.py#L29.

As well, it has to be added one column to indicate the name of the file to be used. By default it should use the name of the file.

shruthibandyadka commented 6 years ago

I'm sorry I wrongly referenced this issue in my previous pull request. It should have been Issue #24 instead. But I'll work on this if it's still open. To clarify, did you mean the following ? -

def _calc_stats(fn):

    samples = _get_samples(fn)
  ..... 
    ##use this filename 'fn' to add a new column to the dataframe, containing fn. 
    with open(fn) as inh:
        for line in inh:
            if line.startswith("#"):
     ....... 
      df = _summary(lines)   ###HERE ADD NEW COLUMN TO THIS DF with name of file passed to function.