I am using the following Github repository that I cloned. One apparent issue is that it is using an old/defunct link for the phenotype_to_genes.txt that is no longer active and after several tries I found what seems to be the correct link. However, I cannot seem to get it to work as it seems to be throwing up an error that makes no sense to me when I try and run it via a bash script:
Variable I defined in advance:
pedigree_file
has the path to the pedigree file with 4 columns (Family ID, individual_ID,Status [Child,Father,Mother,Sibling], Sex [Male or Female] and Phenotype [Affected or Unaffected]Mendelian
a path to a file created via Mendelian filteringoutput_dir
path to the output directoryphenotype_path
a path to a file with 2 columns group/family and then HPOVC_Python_directory
path to the variant filtering directoryMap_File
path to the phenotype_to_genes.txtfamily_names
a list of family/group names
The bash script:
cd "$VC_Python_directory"
IFS=',' read -ra family_array <<< "$family_names"
for family_name in "${family_array[@]}"; do
# Concatenate the file path
file_path="$output_dir/$family_name.txt"
# Echo the family name and file path
echo "Family Name: ${family_name}"
echo "File Path: ${file_path}"
# Run the Python script with the correct arguments
python main.py -p "$pedigree_file" --data "$Mendelian" --output "$file_path" --family "$family_name" -ph "$phenotype_path" --mapfile "$Map_File"
done
The error:
Family Name: Sample_1
File Path: /path/to/output_directory/Sample_1.txt
Path/to/variant-filtering/utils.py:77: DtypeWarning: Columns (2) have mixed types. Specify dtype option on import or set low_memory=False.
phen_to_genes = pd.read_csv(mapfile, sep = '\t', header = None, comment = '#')
Getting relevant genes for family phenotypes...
Traceback (most recent call last):
File “path/to/variant-filtering/main.py", line 26, in <module>
load_phen(families, args.phenfile, args.mapfile)
File “path/to/variant-filtering/utils.py", line 80, in load_phen
phen_to_genes.columns = ["HPO-id", "HPO label", "gene-id",
File “path/to/python3.10/site-packages/pandas/core/generic.py", line 6002, in __setattr__
return object.__setattr__(self, name, value)
File "pandas/_libs/properties.pyx", line 69, in pandas._libs.properties.AxisProperty.__set__
File “/path/to/generic.py", line 730, in _set_axis
self._mgr.set_axis(axis, labels)
File “/path/to/managers.py", line 225, in set_axis
self._validate_set_axis(axis, new_labels)
File “/path/to/base.py", line 70, in _validate_set_axis
raise ValueError(
ValueError: Length mismatch: Expected axis has 5 elements, new values have 7 elements
I have checked over the pedigree file and map file and phenotype path files but I am really unsure of how to go about this pipeline as I have never seen this kind of error before. I am not sure I can ask this here but does anyone perchance have an inkling as to what is causing the rather peculiar error?