MosaicForecast
MosaicForecast copied to clipboard
Problem with ReadLevel_Features_extraction.py
Hi, I'm getting an error when I run the ReadLevel_Features_extraction.py with my data.
It seems to be a very similar to issue #16 so I made sure that all the reads present in my data have the NM tag and removed all unpaired reads but I'm still encountering this error. I'm using this script as part of the provided Snakemake pipeline and only encountering this error during the feature_extraction_INS rule. I'm using hg38 as the reference and had to edit the pipeline a bit to update reference paths.
python ReadLevel_Features_extraction.py MF/78-36428.MAF0.INS.bed MF/78-36428.INS.features bam_links_case/ references/human/hg38/Homo_sapiens_assembly38.fasta references/k24.umap.wg.bw 4 bam not enough alt reads: chr8 48110917 48110918 not enough alt reads: chr12 108598257 108598258 not enough alt reads: chr3 186113338 186113339 not enough alt reads: chr7 61053234 61053235 not enough alt reads: chr11 5105732 5105733 not enough alt reads: chr4 42822186 42822187 Traceback (most recent call last): File "/data/fiskb2/miniconda3/envs/pysamstats/lib/python3.7/site-packages/pandas/core/frame.py", line 3520, in _ensure_valid_index value = Series(value) File "/data/fiskb2/miniconda3/envs/pysamstats/lib/python3.7/site-packages/pandas/core/series.py", line 313, in init data = SingleBlockManager(data, index, fastpath=True) File "/data/fiskb2/miniconda3/envs/pysamstats/lib/python3.7/site-packages/pandas/core/internals/managers.py", line 1515, in init block = make_block(block, placement=slice(0, len(axis)), ndim=1) File "/data/fiskb2/miniconda3/envs/pysamstats/lib/python3.7/site-packages/pandas/core/internals/blocks.py", line 3265, in make_block return klass(values, ndim=ndim, placement=placement) File "/data/fiskb2/miniconda3/envs/pysamstats/lib/python3.7/site-packages/pandas/core/internals/blocks.py", line 2773, in init super().init(values, ndim=ndim, placement=placement) File "/data/fiskb2/miniconda3/envs/pysamstats/lib/python3.7/site-packages/pandas/core/internals/blocks.py", line 128, in init "{mgr}".format(val=len(self.values), mgr=len(self.mgr_locs)) ValueError: Wrong number of items passed 38, placement implies 0
During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/data/NHLBI_IDSS/projects/NHLBI-13/MosaicForecast/ReadLevel_Features_extraction.py", line 984, in
df['querypos_p']=df.apply(lambda row: my_wilcox_pvalue(row['querypos_major'], row['querypos_minor']), axis=1) File "/data/fiskb2/miniconda3/envs/pysamstats/lib/python3.7/site-packages/pandas/core/frame.py", line 3467, in setitem self._set_item(key, value) File "/data/fiskb2/miniconda3/envs/pysamstats/lib/python3.7/site-packages/pandas/core/frame.py", line 3543, in _set_item self._ensure_valid_index(value) File "/data/fiskb2/miniconda3/envs/pysamstats/lib/python3.7/site-packages/pandas/core/frame.py", line 3523, in _ensure_valid_index "Cannot set a frame with no defined index " ValueError: Cannot set a frame with no defined index and a value that cannot be converted to a Series