sjteresi / TE_Density

Python script calculating transposable element density for all genes in a genome. Publication: https://mobilednajournal.biomedcentral.com/articles/10.1186/s13100-022-00264-4
GNU General Public License v3.0
28 stars 4 forks source link

post-processing #144

Closed asdfjohnny1 closed 7 months ago

asdfjohnny1 commented 9 months ago

Hello,

I am trying to recreate the chi_squared_density_comparison.py which is in the examples for Arabidopsis.

When I run it, it come up with this error in the Density_data.py but I am not sure how to resolve it

Traceback (most recent call last): File "/gpfs/home/jah14xyu/RNA_Sequencing/TE/TE_Density/Scripts/chi_squared_density_comparison.py", line 214, in save_arrays_for_pat(processed_dd_data, args.output_dir) File "/gpfs/home/jah14xyu/RNA_Sequencing/TE/TE_Density/Scripts/chi_squared_density_comparison.py", line 65, in save_arrays_for_pat helitron_upstream_array = { File "/gpfs/home/jah14xyu/RNA_Sequencing/TE/TE_Density/Scripts/chi_squared_density_comparison.py", line 68, in ): single_dd_obj.get_specific_slice("Order", "Helitron", "Upstream", 1000).slice File "/gpfs/home/jah14xyu/.conda/envs/TEdensity/lib/python3.10/site-packages/transposon/density_data.py", line 363, in get_specific_slice self._verify_te_name(te_category, te_name) File "/gpfs/home/jah14xyu/.conda/envs/TEdensity/lib/python3.10/site-packages/transposon/density_data.py", line 186, in _verify_te_name % (direction, acceptable_te_name_list) NameError: name 'direction' is not defined

All the best, Johnny

sjteresi commented 9 months ago

Hi, My apologies for the slow response.

I think that is both a bug on my end and on your end.

My end: I was trying to make an error message for users if they try to subset a TE type that is not present in their data. Here, I should not have used direction as it is not available to this function, and that is causing my error message to make an error of its own.

Your end: Please verify that you indeed have Helitron data in that specific instance of DensityData. Perhaps that specific chromosome doesn't have any Helitron elements?

asdfjohnny1 commented 9 months ago

Hi,

sorry for my slow response also,

what would you recommend I do for the error about "direction" ?

as for helitrons, it is very likely it doesnt contain helitrons, I don't quite get why it's specifically selecting for them ? could it not move on if there are no helitrons in the chromosome ?

thank you for your reply, Johnny

sjteresi commented 9 months ago

It is requesting helitrons because you are asking for helitrons in the function call of single_dd_obj.get_specific_slice("Order", "Helitron", "Upstream", 1000).slice.

I will try to introduce a fix for the error with direction but in short, that error shows up when you ask for a TE type in your data that does not exist. The error message was written wrong, but the error is still valid.