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

Incorrect version of beagle when using conda install monopogen #69

Open
hima-anbunathan-takara opened this issue Jul 11, 2024 · 5 comments

Comments

@hima-anbunathan-takara
Copy link

Hi,

When installing using conda, this version of beagle is installed; beagle.27May24.118.jar. However, the source code (germline.py) indicates that it looks for these two versions of beagle - beagle.08Feb22.fa4.jar and beagle.27Jul16.86a.jar. Can this be changed to ensure that conda installs the version of beagle that monopogen uses?

Thanks,
Hima

@jinzhuangdou
Copy link
Collaborator

Does it work to intall by specifying the beagle version? conda install -c bioconda beagle=27Jul16.86a
If it does not work, you can manually add the JAR file of beagle.27Jul16.86a.jar to your conda environment.

@hima-anbunathan-takara
Copy link
Author

Looks like this version of beagle is not available with conda install

PackagesNotFoundError: The following packages are not available from current channels:

  • beagle=27Jul16.86a*

@MikeDMorgan
Copy link

FYI - if one of the beagle versions is missing germline.py will error - currently only one (beagle.27Jul16.86a.jar) is included on the main branch.

@yu-tong-wang
Copy link

FYI - if one of the beagle versions is missing germline.py will error - currently only one (beagle.27Jul16.86a.jar) is included on the main branch.

Yes. When running Monopogen on Linux, I encountered an error related to the Beagle dependency. The error message indicates that the script is looking for beagle.08Feb22.fa4.jar, but this file is not present in the apps folder. Instead, beagle.27Jul16.86a.jar is available.

The script fails with the following error:
CopyAssertionError: Program beagle.08Feb22.fa4.jar cannot be found!

Relevant Code:
In src/germline.py, the check_dependencies function includes:

def check_dependencies(args):
    programs_to_check = ("vcftools", "bgzip",  "bcftools", "beagle.08Feb22.fa4.jar", "beagle.27Jul16.86a.jar","samtools","picard.jar", "java")
    for prog in programs_to_check:
        out = os.popen("command -v {}".format(args.app_path + "/" + prog)).read()
        assert out != "", "Program {} cannot be found!".format(prog)

@swvanderlaan
Copy link

I wrote this:

def check_dependencies(args):
	# NEW code -- 2024-08-15
	# these programs are installed via conda/mamba
	programs_to_check = ("vcftools", "bgzip",  "bcftools", "samtools", "java")

	for prog in programs_to_check:
		# NEW code -- 2024-08-15
		location_prog = subprocess.check_output(['which', prog]).strip().decode('utf-8')
		progr_out = os.popen("command -v {}".format(location_prog)).read()
		if args.debug:
			print(f"DEBUGGING: progr_out = {progr_out}")
		assert progr_out != "", "Program {} cannot be found!".format(prog)
	# NEW code -- 2024-08-15
	# these programs are downloaded via the Monopogen github repository
	jars_to_check = ("beagle.27Jul16.86a.jar", "picard.jar")
	for jar in jars_to_check:
		jar_path = os.path.join(args.app_path, jar)
		if args.debug:
			print(f"DEBUGGING: Checking JAR file at {jar_path}")
		assert os.path.isfile(jar_path), "Java jar file {} cannot be found at path {}!".format(jar, jar_path)

However, a few things:

  • I don't believe BEAGLE is available via pip nor conda or is it?
  • As far as I can tell, we can use the latest version of BEAGLE 5.4 safely - but I need to double check each flag
  • In Monopogen.py there is already a check for required programs. I think this should be the only place where this should be checked.
  • In Monopogen.py it doesn't check for vcftools while it should.
  • In the Readme.md it doesn't note to install vcftools nor which version.
  • It is better not to hardcode these program versions, rather, to check for a version and require users to install 1) either a specific version or 2) a version from a given version upwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants