Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANNDATA_BARCODES terminates with Missing output file(s) *.h5ad expected by process #431

Open
fbnrst opened this issue Feb 16, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@fbnrst
Copy link

fbnrst commented Feb 16, 2025

Description of the bug

I started a run of the dev branch and I did run into the following error:

ERROR ~ Error executing process > 'NFCORE_SCRNASEQ:SCRNASEQ:H5AD_REMOVEBACKGROUND_BARCODES_CELLBENDER_ANNDATA:ANNDATA_BARCODES (Fibrosis-LT_Agg20_Second)'

Caused by:
  Missing output file(s) `*.h5ad` expected by process `NFCORE_SCRNASEQ:SCRNASEQ:H5AD_REMOVEBACKGROUND_BARCODES_CELLBENDER_ANNDATA:ANNDATA_BARCODES (Fibrosis-LT_Agg20_Second)` (note: input files are not included in the default matching set)


Command executed [/home/rost/.nextflow/assets/nf-core/scrnaseq/./workflows/../subworkflows/nf-core/h5ad_removebackground_barcodes_cellbender_anndata/../../../modules/nf-core/anndata/barcodes/templates/barcodes.py]:

  #!/usr/bin/env python3

  import platform

  import anndata as ad
  import pandas as pd


  def format_yaml_like(data: dict, indent: int = 0) -> str:
      """Formats a dictionary to a YAML-like string.

      Args:
          data (dict): The dictionary to format.
          indent (int): The current indentation level.

      Returns:
          str: A string formatted as YAML.
      """
      yaml_str = ""
      for key, value in data.items():
          spaces = "    " * indent
          if isinstance(value, dict):
              yaml_str += f"{spaces}{key}:\n{format_yaml_like(value, indent + 1)}"
          else:
              yaml_str += f"{spaces}{key}: {value}\n"
      return yaml_str


  df = pd.read_csv("Fibrosis-LT_Agg20_Second_cell_barcodes.csv", header=None)
  adata = ad.read_h5ad("Fibrosis-LT_Agg20_Second_raw_matrix.h5ad")

  adata = adata[df[0].values]

  adata.write_h5ad("Fibrosis-LT_Agg20_Second_raw_matrix.h5ad")

  # Versions

  versions = {
      "NFCORE_SCRNASEQ:SCRNASEQ:H5AD_REMOVEBACKGROUND_BARCODES_CELLBENDER_ANNDATA:ANNDATA_BARCODES": {"python": platform.python_version(), "anndata": ad.__version__, "pandas": pd.__version__}
  }

  with open("versions.yml", "w") as f:
      f.write(format_yaml_like(versions))

Command exit status:
  0

Command output:
  (empty)

Command error:
  INFO:    Could not find any nv files on this host!

Work dir:
  /lustre/projects/mouse_assembloid/data_analysis/rost/fr_ma_3/analysis/04_nf-core_scrnaseq/work/af/97961ba68a1b0eb5b4ca9aedafb86b

Container:
  /projects/Fabian_Rost/home_stuff/nxf_singularity_cachedir/community.wave.seqera.io-library-anndata-0.10.9--d13580e4b297da7c.img

Tip: you can try to figure out what's wrong by changing to the process work dir and showing the script file named `.command.sh`

 -- Check '.nextflow.log' file for details
ERROR ~ Pipeline failed. Please refer to troubleshooting docs: https://nf-co.re/docs/usage/troubleshooting

 -- Check '.nextflow.log' file for details

Seems like input and output file are the same in the python script.

I could work around by adding this to my nextflow.config:

withName: ANNDATA_BARCODES {
        ext.prefix = 'output'
    }

Command used and terminal output

Relevant files

No response

System information

No response

@fbnrst fbnrst added the bug Something isn't working label Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant