editasmedicine / uditas

Software for performing UDiTaS sequencing analysis.
BSD 3-Clause Clear License
13 stars 11 forks source link

biopython=1.77 needed & pytest failing #6

Open tohsumi-bebio opened 1 year ago

tohsumi-bebio commented 1 year ago

Greetings,

I am interested in running the UDiTaS pipeline. I notice that Bio.Alphabet is removed from Biopython since version 1.78. Your code uses it in uditas/uditas_helpers.py, IUPAC.unambiguous_data. Thus, I added =1.77after the biopython entry in uditas_env.yml. After creating the environment and setting the environment variables BOWTIE2_INDEXES and GENOMES_2BIT, I ran pytest, but got the below output and error. Might you know what may be going on here? I imagine that the output is not what is to be expected. Many thanks,

        Toshi

============================= test session starts ==============================
platform linux -- Python 3.9.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /opt/packages/uditas
collected 3 items

test/test_fig2a.py F                                                     [ 33%]
test/test_fig2b.py F                                                     [ 66%]
test/test_fig2c.py F                                                     [100%]

=================================== FAILURES ===================================
__________________________________ test_fig2a __________________________________

    def test_fig2a():
        df1 = get_df_fig2a()
        df2 = get_test_df_fig2a()

>       assert (df1['Editing Percent'] - df2['Editing Percent']).sum() < 0.00001
E       assert 0.017294756018340185 < 1e-05
E        +  where 0.017294756018340185 = <bound method NDFrame._add_numeric_operations.<locals>.sum of 0    -0.000238\n1    -0.010445\n2     0.034534\n3    -0.016...  NaN\n14         NaN\n15         NaN\n16         NaN\n17    0.030000\n18   -0.012705\nName: Editing Percent, dtype: float64>()
E        +    where <bound method NDFrame._add_numeric_operations.<locals>.sum of 0    -0.000238\n1    -0.010445\n2     0.034534\n3    -0.016...  NaN\n14         NaN\n15         NaN\n16         NaN\n17    0.030000\n18   -0.012705\nName: Editing Percent, dtype: float64> = (0      0.576606\n1     25.350082\n2     16.186161\n3     40.280066\n4     17.462932\n5           NaN\n6           NaN\n7     ...N\n14          NaN\n15          NaN\n16          NaN\n17    75.090000\n18    98.455187\nName: Editing Percent, dtype: float64 - 0      0.576844\n1     25.360527\n2     16.151628\n3     40.296663\n4     17.470128\n5           NaN\n6           NaN\n7     ...N\n14          NaN\n15          NaN\n16          NaN\n17    75.060000\n18    98.467892\nName: Editing Percent, dtype: float64).sum

test/test_fig2a.py:28: AssertionError
----------------------------- Captured stdout call -----------------------------
/opt/packages/uditas
['./uditas-runner.py', './data/fig2a']

UDiTaS version 1.1

Processing UDiTaS data in folder /opt/packages/uditas/data/fig2a
__________________________________ test_fig2b __________________________________

    def test_fig2b():
        df1 = get_df_fig2b()
        df2 = get_test_df_fig2b()

>       assert (df1['Editing Percent'] - df2['Editing Percent']).sum() < 0.00001
E       assert 0.038536665568289274 < 1e-05
E        +  where 0.038536665568289274 = <bound method NDFrame._add_numeric_operations.<locals>.sum of 0               NaN\n1               NaN\n2               ...085e-14\n187    1.421085e-14\n188    8.059926e-05\n189    0.000000e+00\nName: Editing Percent, Length: 190, dtype: float64>()
E        +    where <bound method NDFrame._add_numeric_operations.<locals>.sum of 0               NaN\n1               NaN\n2               ...085e-14\n187    1.421085e-14\n188    8.059926e-05\n189    0.000000e+00\nName: Editing Percent, Length: 190, dtype: float64> = (0            NaN\n1            NaN\n2            NaN\n3            NaN\n4            NaN\n         ...    \n185    99.793231\n186    99.719511\n187    98.755043\n188    99.746112\n189    99.832636\nName: Editing Percent, Length: 190, dtype: float64 - 0            NaN\n1            NaN\n2            NaN\n3            NaN\n4            NaN\n         ...    \n185    99.793231\n186    99.719511\n187    98.755043\n188    99.746032\n189    99.832636\nName: Editing Percent, Length: 190, dtype: float64).sum

test/test_fig2b.py:28: AssertionError
----------------------------- Captured stdout call -----------------------------
/opt/packages/uditas
['./uditas-runner.py', './data/fig2b']

UDiTaS version 1.1

Processing UDiTaS data in folder /opt/packages/uditas/data/fig2b
__________________________________ test_fig2c __________________________________

    def test_fig2c():
        df1 = get_df_fig2c()
        df2 = get_test_df_fig2c()

>       assert (df1['Editing Percent'] - df2['Editing Percent']).sum() < 0.00001
E       assert 0.41675299731745297 < 1e-05
E        +  where 0.41675299731745297 = <bound method NDFrame._add_numeric_operations.<locals>.sum of 0          NaN\n1          NaN\n2          NaN\n3          ...0.292271\n72    0.042804\n73    0.038192\n74    0.136178\n75    0.165667\nName: Editing Percent, Length: 76, dtype: float64>()
E        +    where <bound method NDFrame._add_numeric_operations.<locals>.sum of 0          NaN\n1          NaN\n2          NaN\n3          ...0.292271\n72    0.042804\n73    0.038192\n74    0.136178\n75    0.165667\nName: Editing Percent, Length: 76, dtype: float64> = (0           NaN\n1           NaN\n2           NaN\n3           NaN\n4      0.000000\n        ...    \n71    88.458070\n72    17.008527\n73    17.470018\n74    33.106576\n75    32.223355\nName: Editing Percent, Length: 76, dtype: float64 - 0           NaN\n1           NaN\n2           NaN\n3           NaN\n4      0.000000\n        ...    \n71    88.165799\n72    16.965723\n73    17.431826\n74    32.970398\n75    32.057688\nName: Editing Percent, Length: 76, dtype: float64).sum

test/test_fig2c.py:28: AssertionError
----------------------------- Captured stdout call -----------------------------
/opt/packages/uditas
['./uditas-runner.py', './data/fig2c']

UDiTaS version 1.1

Processing UDiTaS data in folder /opt/packages/uditas/data/fig2c
=========================== short test summary info ============================
FAILED test/test_fig2a.py::test_fig2a - assert 0.017294756018340185 < 1e-05
FAILED test/test_fig2b.py::test_fig2b - assert 0.038536665568289274 < 1e-05
FAILED test/test_fig2c.py::test_fig2c - assert 0.41675299731745297 < 1e-05
======================== 3 failed in 375.39s (0:06:15) =========================
eugeniomarco commented 1 year ago

Thanks @tohsumi-bebio I just created a PR with a new environment that solves this issues. I tested it on several machines and the tests all passed. Let me know if you still have any issues.

tohsumi-bebio commented 1 year ago

Dear Dr. Rubio,

Thank you very much. How can I retrieve the updated code? I just tried to clone the repository, https://github.com/editasmedicine/uditas.git, but still getting errors on Debian. Many thanks,

Toshi

eugeniomarco commented 1 year ago

Dear @tohsumi-bebio , the PR has been merged and you can pull the new code. Only the yaml file to create the conda environment has changed.

Let me know if you have any issues.

JkbWktr commented 1 year ago

I am having the same error as tohsumi-bebio. I have made a conda environment from the current 'uditas_env.yml' file but the tests 2a and 2b fail. Can be this a problem outside of the scope of the environment? I welcome any suggestions how to fix it.

=========================== short test summary info ============================ FAILED test/test_fig2a.py::test_fig2a - assert 0.0031203054434319477 < 1e-05 FAILED test/test_fig2b.py::test_fig2b - assert 0.003202984373900788 < 1e-05 =================== 2 failed, 1 passed in 412.10s (0:06:52) ====================