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

AttributeError: 'LayoutLine' object has no attribute 'order' #735

Open
pk-zhu opened this issue Jan 1, 2025 · 6 comments
Open

AttributeError: 'LayoutLine' object has no attribute 'order' #735

pk-zhu opened this issue Jan 1, 2025 · 6 comments

Comments

@pk-zhu
Copy link

pk-zhu commented Jan 1, 2025

Dear Support,

I hope this message finds you well. I have encountered an issue and would greatly appreciate your assistance.

python -m jcvi.graphics.karyotype seqids.txt layout.txt
[23:40:42] INFO Note: NumExpr detected 56 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8. utils.py:148
INFO NumExpr defaulting to 8 threads. utils.py:160
[23:40:43] ERROR Set text.usetex=False. Font styles may be inconsistent. base.py:393
DEBUG Load file layout.txt base.py:37
DEBUG Load file Cdes.bed base.py:37
[23:40:44] DEBUG Load file Peds.bed base.py:37
Traceback (most recent call last):
File "/pub/anaconda3/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/pub/anaconda3/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/pub/anaconda3/lib/python3.8/site-packages/jcvi/graphics/karyotype.py", line 447, in
main()
File "/pub/anaconda3/lib/python3.8/site-packages/jcvi/graphics/karyotype.py", line 427, in main
Karyotype(
File "/pub/anaconda3/lib/python3.8/site-packages/jcvi/graphics/karyotype.py", line 346, in init
layout = Layout(layoutfile, generank=generank)
File "/pub/anaconda3/lib/python3.8/site-packages/jcvi/graphics/karyotype.py", line 78, in init
blocks = self.parse_blocks(fn, i)
File "/pub/anaconda3/lib/python3.8/site-packages/jcvi/graphics/karyotype.py", line 86, in parse_blocks
order = self[i].order
AttributeError: 'LayoutLine' object has no attribute 'order'

head Peds.bed

Ped07D 1762 5299 EVM0015331.1 0 - 1762 5299 255,0,0 5 193,38,68,93,88 0,2591,2665,2928,3449
Ped07D 12578 16711 EVM0022403.1 0 + 12635 16242 255,0,0 10 57,110,58,264,138,52,80,60,81,562 0,700,910,1609,1974,2191,2322,2709,3327,3571
Ped07D 20057 32716 EVM0009251.1 0 - 20057 32716 255,0,0 2 405,210 0,12449
Ped07D 136305 143834 EVM0016564.1 0 + 136429 143311 255,0,0 5 124,116,244,1524,703 0,471,4752,5220,6826
Ped07D 159903 161676 EVM0009065.1 0 + 159903 161676 255,0,0 1 1773 0

Looking forward to your prompt reply.

@Adamtaranto
Copy link
Collaborator

Please post your layout.txt file and the head of seqids.txt

@Adamtaranto
Copy link
Collaborator

Check that the BED files referred to in your layout file are formatted like this example. They should be tab delimited with 7 cols.

@pk-zhu
Copy link
Author

pk-zhu commented Jan 3, 2025

Please post your layout.txt file and the head of seqids.txt

$ cat seqids.txt
A1,A10,A11,A12,A2,A3,A4,A5,A6,A7,A8,A9,B1,B10,B11,B12,B2,B3,B4,B5,B6,B7,B8,B9
Ped01C,Ped01D,Ped02C,Ped02D,Ped03C,Ped03D,Ped04C,Ped04D,Ped05C,Ped05D,Ped06C,Ped06D,Ped07C,Ped07D,Ped08C,Ped08D,Ped09C,Ped09X,Ped10C,Ped10D,Ped11C,Ped11D,Ped12C,Ped12D

$ cat layout.txt

y, xstart, xend, rotation, color, label, va, bed

.6, .1, .9, 0, , Cdes, top, Cdes.bed
.4, .1, .9, 0, , Peds, bottom, Peds.bed

edges

e, 0, 1, Cdes.Peds.anchors.simple

@pk-zhu
Copy link
Author

pk-zhu commented Jan 3, 2025

Check that the BED files referred to in your layout file are formatted like this example. They should be tab delimited with 7 cols.

$ cat -A Cdes.bed |head
A1^I141892^I144685^ICde1A1G000010.1^I0^I-^I0$
A1^I191807^I196929^ICde1A1G000020.1^I0^I+^I0$
A1^I199560^I207285^ICde1A1G000030.1^I0^I-^I0$
A1^I223574^I226367^ICde1A1G000040.1^I0^I-^I0$
A1^I237103^I250991^ICde1A1G000050.1^I0^I+^I0$
A1^I452164^I454084^ICde1A1G000060.1^I0^I+^I0$
A1^I886095^I886722^ICde1A1G000070.1^I0^I-^I0$
A1^I958065^I958971^ICde1A1G000080.1^I0^I+^I0$
A1^I1253151^I1264032^ICde1A1G000090.1^I0^I+^I0$
A1^I1565339^I1565842^ICde1A1G000100.1^I0^I-^I0$

$ cat -A Peds.bed |head
Ped08C^I3565^I4156^IEVM0039203.1^I0^I+^I0$
Ped08C^I6470^I10172^IEVM0031106.1^I0^I-^I0$
Ped08C^I24398^I26060^IEVM0033975.1^I0^I-^I0$
Ped08C^I32461^I35845^IEVM0047455.1^I0^I+^I0$
Ped08C^I84099^I88111^IEVM0051843.1^I0^I+^I0$
Ped08C^I113185^I116744^IEVM0024039.1^I0^I-^I0$
Ped08C^I152330^I153353^IEVM0025742.1^I0^I-^I0$
Ped08C^I221686^I224765^IEVM0027074.1^I0^I+^I0$
Ped08C^I227548^I230532^IEVM0030317.1^I0^I+^I0$
Ped08C^I239084^I240491^IEVM0002302.1^I0^I+^I0$

@pk-zhu
Copy link
Author

pk-zhu commented Jan 3, 2025

Check that the BED files referred to in your layout file are formatted like this example. They should be tab delimited with 7 cols.

It seems that this BED sample has only six columns. I tried both seven-column and six-column formats, but I still get the same error.

@pk-zhu
Copy link
Author

pk-zhu commented Jan 3, 2025

Thank you for your help. This was a careless mistake on my part. I have identified the problem: it was caused by an unintended blank line at the start of the layout.txt file, which occurred when using the echo command.

echo "

y, xstart, xend, rotation, color, label, va, bed

.6, .1, .9, 0, red, C. delicatus, top, Cdes.bed
.4, .1, .9, 0, green, P. edulis, bottom, Peds.bed

edges

e, 0, 1, Cdes.Peds.anchors.simple" > layout.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants