Merck / Line-of-Therapy-Algorithm

This is the Line of Therapy Algorithm, as described in the paper "Temporal phenotyping by mining healthcare data to derive lines of therapy for cancer" pending submission in the Journal of Biomedical Informatics.
GNU General Public License v3.0
26 stars 14 forks source link

cycle information missing #6

Open jwu19 opened 2 months ago

jwu19 commented 2 months ago

In line 141 in rwToT_Lot_line.py, df['CYCLE'] is not defined anywhere before

r_regimen = df[df['CYCLE']==df.loc[i, 'CYCLE']]['MED_NAME'].unique()

Weilin37 commented 2 months ago

I personally did not write the python code and wrote the R version instead, which does not include any cycles. I would imagine that the df['CYCLE'] is referring to a column from the input CSV. There should be an example input CSV file in one of the folders.

jwu19 commented 2 months ago

i have checked the csv file as attached, but there is no 'cycle' column in the file example_input.csv

Weilin37 commented 1 month ago

OK, would the code work if you inserted a CYCLE column in the file?

jwu19 commented 1 month ago

Currently I just removed the cycle column from the calculation to make the code work as I do not have the cycle information. This will result in commenting the two-cycle rule code in line 133-140 in rwToT_LoT_line.py as below

        # Line is not advanced because two-cycle rule is not met
        # elif (next_drug in r_regimen) == False and

(has_eligible_drug_addition == False) and (has_eligible_drug_substition == False) and two_cycles == False: # V.S. 2020/10/01

r_regimen = df[df['CYCLE']==df.loc[i,

'CYCLE']]['MED_NAME'].unique()

V.S. 2020/10/01

        #     drug_dates =

df[df['MED_NAME'].isin(r_regimen)]['MED_START']

V.S. 2020/10/01

        #     adjusted_line_start = min(drug_dates)

          # V.S. 2020/10/01
        #     line_end_date = max(drug_dates)

          # V.S. 2020/10/01
        #     line_end_reason = "New line started with new drugs"

          # V.S. 2020/10/01
        #     line_next_start = next_drug_date

On Wed, May 15, 2024, 9:18 AM Weilin Meng @.***> wrote:

OK, would the code work if you inserted a CYCLE column in the file?

— Reply to this email directly, view it on GitHub https://github.com/Merck/Line-of-Therapy-Algorithm/issues/6#issuecomment-2112497098, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB532EPB6ILU65MFQG65P5DZCNOBJAVCNFSM6AAAAABG6NS6Y2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJSGQ4TOMBZHA . You are receiving this because you authored the thread.Message ID: @.***>