lpantano / isomiRs

analyze isomiRs from seqbuster tool
http://lpantano.github.io/isomiRs/
MIT License
8 stars 3 forks source link

input error with mirtop export file #16

Open kicheolkim opened 4 years ago

kicheolkim commented 4 years ago

Hi,

I wanted to analyze isomiR output using your isomiRs package. We already set up miRNA pipeline with sRNAbench, so I tried to convert from sRNAbench output to isomiRs input using mirtop. The sRNAbench output was imported to mirtop, then the gff file export to isomir format. But isomiR package shows an error when I input the files in the R. Here is the error message:

Error in [.data.frame(table, , c("seq", "freq", "mir", "mism", "add", : undefined columns selected

I also tried to export as a seqbuster format in mirtop, but now mirtop shows error like below. In the last part "KeyError", miRNA id is different depending on samples.

Traceback (most recent call last): File "/Users/kicheol/miniconda2/envs/mirna/bin/mirtop", line 10, in sys.exit(main()) File "/Users/kicheol/miniconda2/envs/mirna/lib/python3.7/site-packages/mirtop/command_line.py", line 45, in main export(kwargs["args"]) File "/Users/kicheol/miniconda2/envs/mirna/lib/python3.7/site-packages/mirtop/exporter/init.py", line 9, in export seqbuster.convert(args) File "/Users/kicheol/miniconda2/envs/mirna/lib/python3.7/site-packages/mirtop/exporter/seqbuster.py", line 29, in convert _read_file(fn, precursors, matures, args.out) File "/Users/kicheol/miniconda2/envs/mirna/lib/python3.7/site-packages/mirtop/exporter/seqbuster.py", line 49, in _read_file matures[attr["Parent"]][attr["Name"]], KeyError: 'hsa-miR-548av-5p'

Here is my files for your information.

Thanks, Kicheol

lpantano commented 4 years ago

Thank you for the feedback!

sorry about the issue, I can take a look on Monday. Can you try to install the master version of the isomiR package? and make sure you work with the devel version of mirtop, in case you want to try something else meanwhile I can take a look at this.

thanks!

kicheolkim commented 4 years ago

I'm still seeing the same error message with the develop version... I will wait for you to look at it and update

Thanks!!

lpantano commented 4 years ago

Hi,

When I use:

de <- data.frame(row.names=c("S400001603"),
                 condition = c("cc"))
IsomirDataSeqFromMirtop(read_tsv("~/Downloads/S400001603_rawData.tsv"), de)

that works. Can you check that?

Cheers

kicheolkim commented 4 years ago

It works now! I didn't know about the "IsomirDataSeqFromMirtop" function.

Thank you!!

JFsanchezherrero commented 4 years ago

Hi there @lpantano,

I came with an issue in this sense too.

Once I have exported data from miRTop (either using miraligner, optimir or sRNAbench) and I try to use isomiRs R package I get this error:

ids <- isomiRs::IsomirDataSeqFromMirtop(read_tsv(optimir_test_files), de) Error: Can't subset columns that don't exist. ✖ Locations 2, 7, 6, 5, 4, etc. don't exist. ℹ There are only 1 column.

Backtrace: █

  1. ├─isomiRs::IsomirDataSeqFromMirtop(...)
  2. │ └─isomiRs::IsomirDataSeqFromRawData(mirtop, coldata, ...)
  3. │ └─isomiRs:::.clean_noise(rawdata, pct, whitelist)
  4. │ └─%>%(...)
  5. │ ├─base::withVisible(eval(quote(_fseq(_lhs)), env, env))
  6. │ └─base::eval(quote(_fseq(_lhs)), env, env)
  7. │ └─base::eval(quote(_fseq(_lhs)), env, env)
  8. │ └─isomiRs:::_fseq(_lhs)
  9. │ └─magrittr::freduce(value, _function_list)
    1. │ └─function_list[i]
    2. │ ├─.[, c(1:2, 7:ncol(.))]
    3. │ ├─readr:::[.spec_tbl_df(., , c(1:2, 7:ncol(.)))
    4. │ ├─base::NextMethod([)
    5. │ └─tibble:::[.tbl_df(., , c(1:2, 7:ncol(.)))
    6. │ └─tibble:::tbl_subset_col(x, j = j, j_arg)
    7. │ └─tibble:::vectbl_as_col_index(j, x, j_arg = j_arg)
    8. │ └─tibble:::vectbl_as_col_location(...)
    9. │ ├─tibble:::subclass_col_index_errors(...)
    10. │ │ ├─base::tryCatch(...)
    11. │ │ │ └─base:::tryCatchList(expr, classes, parentenv, handlers)
    12. │ │ │ └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
    13. │ │ │ └─base:::doTryCatch(return(expr), name, parentenv, handler)
    14. │ │ └─base::force(expr)
    15. │ └─vctrs::vec_as_location(j, n, names, arg = as_label(j_arg))
    16. └─vctrs:::stop_subscript_oob(...)
    17. └─vctrs:::stop_subscript(...)

I add some information of this example. I have attached the R sessionInfo() sessionInfo.txt

thanks in advance

head(de) condition SRR7218579_trim_joined A SRR7218580_trim_joined A SRR7218582_trim_joined B SRR7218586_trim_joined B

optimir_test_files [1] "example_PATH/mirtop_export/SRR7218579_optimir.tsv" [2] "example_PATH/mirtop_export/SRR7218580_optimir.tsv" [3] "example_PATH/mirtop_export/SRR7218582_optimir.tsv" [4] "example_PATH/mirtop_export/SRR7218586_optimir.tsv"

head(read.table('example_PATH/mirtop_export/SRR7218579_optimir.tsv')) V1 V2 V3 V4 V5 V6 V7 1 seq mir mism add t5 t3 SRR7218579_trim_joined 2 TGAGGTAGTAGGTTGTATAG hsa-let-7c-5p 0 AG 0 ggtt 3.0 3 TGAGGTAGTAGGTTGTATAGT hsa-let-7c-5p 0 AGT 0 ggtt 2.0 4 TGAGGTAGTAGGTTGTGTGT hsa-let-7b-5p 0 T 0 gtt 2.0 5 TGAGGTAGTAGGTTGTGTGGG hsa-let-7b-5p 0 G 0 tt 1.0 6 TGAGGTAGTAGGTTGTGTGGC hsa-let-7b-5p 0 C 0 tt 4.0