If you exteract two tracks with similar names (let's same say directory) which differ in the last part, when you do gextreact you will get only one of them cause the column name is being cut.
Obviosuly this can be solved by renameing the track name using the gvtrack_create, but still require you to be very carfull in the new name you give, espacilly if adding expression before that - if the name will be longer then 20 you won't be able to extract.
How to reproduce:
`
tracks = {'hematopoesis_bm_sandbox_seacell_tracks.kinetics.erythropoiesis.shared_window_scratch.obs.atac_group_1': 'hematopoesis_bm_sandbox_seacell_tracks.kinetics.erythropoiesis.shared_window_scratch.obs.atac_group_1',
'hematopoesis_bm_sandbox_seacell_tracks.kinetics.erythropoiesis.shared_window_scratch.obs.atac_group_2': 'hematopoesis_bm_sandbox_seacell_tracks.kinetics.erythropoiesis.shared_window_scratch.obs.atac_group_2',
}
interv = pd.DataFrame({
"chrom": ["chr1", "chr1", "chr2"],
"start": [1000, 2000, 3000],
"end": [1500, 2500, 3500]
})
for track_name in tracks:
vtr = track_name
pm.gvtrack_create(vtr, tracks[track_name], 'sum')
tracks_list = ["np.nan_to_num(%s)" % track_name for track_name in tracks]
results = pm.gextract(tracks_list, intervals=interv, iterator=20)
`
Columns:
Index(['chrom', 'start', 'end', 'np.nan_to_num(hematopoesis_bm_sandbox...',
'intervalID'],
dtype='object')
Instead of 2 for tracks
If you exteract two tracks with similar names (let's same say directory) which differ in the last part, when you do gextreact you will get only one of them cause the column name is being cut.
Obviosuly this can be solved by renameing the track name using the gvtrack_create, but still require you to be very carfull in the new name you give, espacilly if adding expression before that - if the name will be longer then 20 you won't be able to extract.
How to reproduce:
`
tracks = {'hematopoesis_bm_sandbox_seacell_tracks.kinetics.erythropoiesis.shared_window_scratch.obs.atac_group_1': 'hematopoesis_bm_sandbox_seacell_tracks.kinetics.erythropoiesis.shared_window_scratch.obs.atac_group_1',
'hematopoesis_bm_sandbox_seacell_tracks.kinetics.erythropoiesis.shared_window_scratch.obs.atac_group_2': 'hematopoesis_bm_sandbox_seacell_tracks.kinetics.erythropoiesis.shared_window_scratch.obs.atac_group_2',
}
interv = pd.DataFrame({
"chrom": ["chr1", "chr1", "chr2"],
"start": [1000, 2000, 3000],
"end": [1500, 2500, 3500]
})
for track_name in tracks:
vtr = track_name
pm.gvtrack_create(vtr, tracks[track_name], 'sum')
tracks_list = ["np.nan_to_num(%s)" % track_name for track_name in tracks]
results = pm.gextract(tracks_list, intervals=interv, iterator=20)
`
Columns:
Index(['chrom', 'start', 'end', 'np.nan_to_num(hematopoesis_bm_sandbox...',
'intervalID'],
dtype='object')
Instead of 2 for tracks