Comments (7)
Dag Jesse,
I wanted to replicate your error, but when opening your file things look a little weird (see below), is everything looking alright on your end? Could you perhaps email the full file?
As methplotlib also told you things would be an enormous lot faster with tabix indexing :-)
Cheers,
Wouter
from methplotlib.
Hi Wouter,
Thank you for the fast reply. I have added the nanopolish output files for you.
meth_calls2_LILBR1.tsv.gz
meth_freqs2_LILRB1.tsv.gz
Where can I find a tool to convert to tabix? This data set is not too big, so Methplotlib was fast anyways.
from methplotlib.
You would have to sort and compress your tsv files with bgzip (e.g. cat <(head -n1 meth_calls2_LILBR1.tsv) <(tail -n +2 meth_calls2_LILBR1.tsv | sort -k2,2 -k3,3) | bgzip > meth_freqs2_LILRB1.tsv.gz
), and then just run tabix -S1 -s1 -b3 -e4
for calls or tabix -S1 -s1 -b2 -e3
for frequencies.
If you don't have tabix already you can install it with conda (https://anaconda.org/bioconda/tabix).
But the cause of the error you saw is this: you specified a very long interval: "19:5440600-54424828" and I think you want 19:54406000-54424828.
This leads to the error because methplotlib will start chopping up your interval in chunks if it's too long to plot in one go. The first interval from your very large window would then be 19:5440600-6440279, which is indeed empty, and thus throws the error.
I think it would make more sense if methplotlib then just skips ahead to the next sub-interval, but that's a bit hard in how I wrote the code right now. I'll think about it :)
from methplotlib.
Thank you for the response. I will try with the tabix files.
The interval issue didnt solve the problem:
methplotlib -m meth_calls2_LILBR1.tsv meth_freqs2_LILRB1.tsv -n Calls Frequencies -w "19:54406000-54424828" -o lilrb1_new.html
Reading meth_calls2_LILBR1.tsv would be faster with bgzip and tabix.
Please index with 'tabix -S1 -s1 -b3 -e4'.
/home/algemeen/anaconda3/lib/python3.7/site-packages/pandas/core/ops.py:1649: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
result = method(y)
Problem parsing nanopolish file meth_calls2_LILBR1.tsv!
Could it be that there are no calls in your selected window?
Detailed error:
Error processing meth_calls2_LILBR1.tsv!
Detailed error:
Traceback (most recent call last):
File "/home/algemeen/anaconda3/bin/methplotlib", line 10, in
sys.exit(main())
File "/home/algemeen/anaconda3/lib/python3.7/site-packages/methplotlib/methplotlib.py", line 17, in main
meth_data = get_data(args.methylation, args.names, window, args.smooth)
File "/home/algemeen/anaconda3/lib/python3.7/site-packages/methplotlib/import_methylation.py", line 30, in get_data
return [read_meth(f, n, window, smoothen) for f, n in zip(methylation_files, names)]
File "/home/algemeen/anaconda3/lib/python3.7/site-packages/methplotlib/import_methylation.py", line 30, in
return [read_meth(f, n, window, smoothen) for f, n in zip(methylation_files, names)]
File "/home/algemeen/anaconda3/lib/python3.7/site-packages/methplotlib/import_methylation.py", line 47, in read_meth
return parse_nanopolish(filename, file_type, name, window, smoothen=smoothen)
File "/home/algemeen/anaconda3/lib/python3.7/site-packages/methplotlib/import_methylation.py", line 101, in parse_nanopolish
gr.pos = np.floor(gr.drop().df[["Start", "End"]].mean(axis=1))
File "/home/algemeen/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py", line 2934, in getitem
raise_missing=True)
File "/home/algemeen/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py", line 1354, in _convert_to_indexer
return self._get_listlike_indexer(obj, axis, **kwargs)[1]
File "/home/algemeen/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py", line 1161, in _get_listlike_indexer
raise_missing=raise_missing)
File "/home/algemeen/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py", line 1246, in _validate_read_indexer
key=key, axis=self.obj._get_axis_name(axis)))
KeyError: "None of [Index(['Start', 'End'], dtype='object')] are in the [columns]"
from methplotlib.
Aha, I identified another issue that I hadn't encountered in my testing. It appears that using "19" as a chromosome (where I commonly have chr19) caused some unforeseen problems. These should now be fixed in methplotlib 0.18.1.
from methplotlib.
Aha, I identified another issue that I hadn't encountered in my testing. It appears that using "19" as a chromosome (where I commonly have chr19) caused some unforeseen problems. These should now be fixed in methplotlib 0.18.1.
This fixed it indeed, thank you!
from methplotlib.
Good to hear! Please let me know if you encounter further issues.
from methplotlib.
Related Issues (20)
- What kind of Nanocompore outputs should be used? HOT 4
- different version different error HOT 19
- Can bam files from guppy version v.6.1.1 be used?
- Python import issue HOT 5
- cannot import name 'get_all_ties'
- bgzip, tabix and sorting HOT 5
- Pandas.error and shape mismatch HOT 17
- Window parameter cannot deal with complicated fasta headers HOT 4
- Remora .bam as a input HOT 7
- mehplotlib having trouble finding sklearn HOT 3
- AttributeError: module 'plotly' has no attribute 'subplots' HOT 1
- sklearn deprecated HOT 1
- problem with HOT 1
- sbatch example of methplotlib HOT 2
- KeyError: 'chr' HOT 3
- Errors supporting bedgraph files HOT 4
- No content in the output image and Error reporting HOT 1
- Input file not recognized HOT 5
- No records for file in in 15_25576970_25685978! HOT 3
- Bacterial genomes. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from methplotlib.