0
$\begingroup$

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 filtering
  • output_dir path to the output directory
  • phenotype_path a path to a file with 2 columns group/family and then HPO
  • VC_Python_directory path to the variant filtering directory
  • Map_File path to the phenotype_to_genes.txt
  • family_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?

$\endgroup$

1 Answer 1

1
$\begingroup$

Apparently the format of the phenotype_to_genes.txt File changed, while at the time when this pipeline was published the file consisted of 7 columns, it only has 5 now. That's what the error message tells you. It's best to file an issue at the github repository to get in touch with the authors. 1) so that other potential users are also aware of this issue and 2) the authors might be willing to fix this issue/help you get an updated version of the pipeline or an older version of the phenotype-file.

$\endgroup$
2
  • $\begingroup$ I was wondering what the original has as I might be able to publish the changes but I doubt I can get in touch with the author again. I think from what I can tell the original is 1. HPO-id: 2. HPO label: 3. gene-id: 4. gene-symbol: 5. gene-name: 6. gene-source: 7. disease-source: $\endgroup$
    – Indira
    Jun 9 at 13:57
  • $\begingroup$ Thank you @Patrick. $\endgroup$
    – Indira
    Jun 9 at 22:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.