How to modify python program to be able to find files on a mapped network drive?

I have downloaded a python program from GitLab here Chie Motono / MDContactCom · GitLab and I would like to use it to analyze files that are located on a mapped network drive. I am using a Windows 10 computer and I am using the command prompt within Anaconda to try to run the program, running python 3.8.8. I have tried several ways of designating the path to the files, including in standard Windows format, the long UNC path, and also the “internet” path, but I continue to get an error that the file could not be accessed or opened:

(base) C:\Users\Christos\Downloads\mdcontactcom-master\mdcontactcom-master>python mdcontactcom run J:/pc/Computational_Experiments/Tests/Molecular_Dynamics_Simulations/QwikMD_or_NAMD/2XQW_Starting_Structure/Wildtype/Morikis_Non_PDBFix_20ns_Test4/Morikis_Non_PDBFix_20ns_Test4/run/MD.dcd -top1 J:/pc/Computational_Experiments/Tests/Molecular_Dynamics_Simulations/QwikMD_or_NAMD/2XQW_Starting_Structure/Wildtype/Morikis_Non_PDBFix_20ns_Test4/Morikis_Non_PDBFix_20ns_Test4/run/Morikis_Non_PDBFix_20ns_Test4_QwikMD.psf J:/pc/Computational_Experiments/Tests/Molecular_Dynamics_Simulations/QwikMD_or_NAMD/2XQW_Starting_Structure/Mutants/C3d_L116V_aka1109_mutant/L116V_aka1109_20ns_Test1/L116V(1109)_20ns_Test1/run/MD.dcd -top2 J:/pc/Computational_Experiments/Tests/Molecular_Dynamics_Simulations/QwikMD_or_NAMD/2XQW_Starting_Structure/Mutants/C3d_L116V_aka1109_mutant/L116V_aka1109_20ns_Test1/L116V(1109)_20ns_Test1/run/L116V(1109)_20ns_Test1_QwikMD.psf
dcdplugin) Could not access file 'J:/pc/Computational_Experiments/Tests/Molecular_Dynamics_Simulations/QwikMD_or_NAMD/2XQW_Starting_Structure/Wildtype/Morikis_Non_PDBFix_20ns_Test4/Morikis_Non_PDBFix_20ns_Test4/run/MD.dcd'.
2022-06-11 22:01:16,110 - traj2pdb.py - Func: convert                   - ERROR    - Could not open file: J:/pc/Computational_Experiments/Tests/Molecular_Dynamics_Simulations/QwikMD_or_NAMD/2XQW_Starting_Structure/Wildtype/Morikis_Non_PDBFix_20ns_Test4/Morikis_Non_PDBFix_20ns_Test4/run/MD.dcd

(base) C:\Users\Christos\Downloads\mdcontactcom-master\mdcontactcom-master>python mdcontactcom run J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd -top1 J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\Morikis_Non_PDBFix_20ns_Test4_QwikMD.psf J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Mutants\C3d_L116V_aka1109_mutant\L116V_aka1109_20ns_Test1\L116V(1109)_20ns_Test1\run\MD.dcd -top2 J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Mutants\C3d_L116V_aka1109_mutant\L116V_aka1109_20ns_Test1\L116V(1109)_20ns_Test1\run\L116V(1109)_20ns_Test1_QwikMD.psf
dcdplugin) Could not access file 'J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd'.
2022-06-11 22:04:53,882 - traj2pdb.py - Func: convert                   - ERROR    - Could not open file: J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd

(base) C:\Users\Christos\Downloads\mdcontactcom-master\mdcontactcom-master>python mdcontactcom run \\128.40.173.237\christos\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd -top1 \\128.40.173.237\christos\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\Morikis_Non_PDBFix_20ns_Test4_QwikMD.psf \\128.40.173.237\christos\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Mutants\C3d_L116V_aka1109_mutant\L116V_aka1109_20ns_Test1\L116V(1109)_20ns_Test1\run\MD.dcd -top2 \\128.40.173.237\christos\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Mutants\C3d_L116V_aka1109_mutant\L116V_aka1109_20ns_Test1\L116V(1109)_20ns_Test1\run\L116V(1109)_20ns_Test1_QwikMD.psf
dcdplugin) Could not access file '\\128.40.173.237\christos\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd'.
2022-06-11 22:09:29,570 - traj2pdb.py - Func: convert                   - ERROR    - Could not open file: \\128.40.173.237\christos\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd

(base) C:\Users\Christos\Downloads\mdcontactcom-master\mdcontactcom-master>python mdcontactcom run file://128.40.173.237/christos/pc/Computational_Experiments/Tests/Molecular_Dynamics_Simulations/QwikMD_or_NAMD/2XQW_Starting_Structure/Wildtype/Morikis_Non_PDBFix_20ns_Test4/Morikis_Non_PDBFix_20ns_Test4/run/MD.dcd -top1 file://128.40.173.237/christos/pc/Computational_Experiments/Tests/Molecular_Dynamics_Simulations/QwikMD_or_NAMD/2XQW_Starting_Structure/Wildtype/Morikis_Non_PDBFix_20ns_Test4/Morikis_Non_PDBFix_20ns_Test4/run/Morikis_Non_PDBFix_20ns_Test4_QwikMD.psf file://128.40.173.237/christos/pc/Computational_Experiments/Tests/Molecular_Dynamics_Simulations/QwikMD_or_NAMD/2XQW_Starting_Structure/Mutants/C3d_L116V_aka1109_mutant/L116V_aka1109_20ns_Test1/L116V(1109)_20ns_Test1/run/MD.dcd -top2 file://128.40.173.237/christos/pc/Computational_Experiments/Tests/Molecular_Dynamics_Simulations/QwikMD_or_NAMD/2XQW_Starting_Structure/Mutants/C3d_L116V_aka1109_mutant/L116V_aka1109_20ns_Test1/L116V(1109)_20ns_Test1/run/L116V(1109)_20ns_Test1_QwikMD.psf
2022-06-11 22:14:54,507 - traj2pdb.py - Func: convert                   - ERROR    - Error: Not Found File: file://128.40.173.237/christos/pc/Computational_Experiments/Tests/Molecular_Dynamics_Simulations/QwikMD_or_NAMD/2XQW_Starting_Structure/Wildtype/Morikis_Non_PDBFix_20ns_Test4/Morikis_Non_PDBFix_20ns_Test4/run/MD.dcd

However, you can also see that I can access the J: drive (the mapped network drive) while I am in the anaconda prompt and the path to the files should be the standard Windows path:

(base) C:\Users\Christos\Downloads\mdcontactcom-master\mdcontactcom-master>J:

(base) J:\>cd pc

(base) J:\pc>cd Computational_Experiments/Tests/Molecular_Dynamics_Simulations/QwikMD_or_NAMD/2XQW_Starting_Structure

(base) J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure>cd
J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure

(base) J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure>cd Wildtype/Morikis_Non_PDBFix_20ns_Test4/Morikis_Non_PDBFix_20ns_Test4/run

(base) J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run>cd
J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run

(base) J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run>dir
 Volume in drive J is christos
 Volume Serial Number is 9411-D2D7

 Directory of J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run

05/22/2022  07:22 PM    <DIR>          .
05/30/2022  08:21 PM    <DIR>          ..
05/22/2022  07:19 PM                 5 Annealing.check
05/22/2022  07:19 PM             2,950 Annealing.conf
05/22/2022  07:20 PM         3,535,344 Annealing.coor
05/22/2022  07:20 PM        18,563,296 Annealing.dcd
05/22/2022  07:20 PM           950,310 Annealing.log
05/22/2022  07:19 PM         1,060,588 Annealing.restart.coor
05/22/2022  07:20 PM         1,060,588 Annealing.restart.coor.old
05/22/2022  07:19 PM         1,060,588 Annealing.restart.vel
05/22/2022  07:19 PM         1,060,588 Annealing.restart.vel.old
05/22/2022  07:19 PM               283 Annealing.restart.xsc
05/22/2022  07:19 PM               290 Annealing.restart.xsc.old
05/22/2022  07:19 PM         3,535,343 Annealing.vel
05/22/2022  07:19 PM               289 Annealing.xsc
05/22/2022  07:20 PM             6,254 Annealing.xst
05/22/2022  07:19 PM                 5 Equilibration.1.check
05/22/2022  07:19 PM             2,900 Equilibration.1.conf
05/22/2022  07:20 PM         3,535,345 Equilibration.1.coor
05/22/2022  07:19 PM       265,186,276 Equilibration.1.dcd
05/22/2022  07:19 PM        10,973,921 Equilibration.1.log
05/22/2022  07:20 PM         1,060,588 Equilibration.1.restart.coor
05/22/2022  07:20 PM         1,060,588 Equilibration.1.restart.coor.old
05/22/2022  07:19 PM         1,060,588 Equilibration.1.restart.vel
05/22/2022  07:19 PM         1,060,588 Equilibration.1.restart.vel.old
05/22/2022  07:19 PM               291 Equilibration.1.restart.xsc
05/22/2022  07:19 PM               290 Equilibration.1.restart.xsc.old
05/22/2022  07:19 PM         3,535,344 Equilibration.1.vel
05/22/2022  07:19 PM               290 Equilibration.1.xsc
05/22/2022  07:20 PM            76,562 Equilibration.1.xst
05/22/2022  07:19 PM                 5 Equilibration.2.check
05/22/2022  07:20 PM             2,906 Equilibration.2.conf
05/22/2022  07:19 PM         3,535,345 Equilibration.2.coor
05/22/2022  07:19 PM       265,186,276 Equilibration.2.dcd
05/22/2022  07:19 PM        10,975,394 Equilibration.2.log
05/22/2022  07:19 PM         1,060,588 Equilibration.2.restart.coor
05/22/2022  07:22 PM         1,060,588 Equilibration.2.restart.coor.old
05/22/2022  07:19 PM         1,060,588 Equilibration.2.restart.vel
05/22/2022  07:19 PM         1,060,588 Equilibration.2.restart.vel.old
05/22/2022  07:19 PM               291 Equilibration.2.restart.xsc
05/22/2022  07:19 PM               291 Equilibration.2.restart.xsc.old
05/22/2022  07:20 PM         3,535,344 Equilibration.2.vel
05/22/2022  07:19 PM               290 Equilibration.2.xsc
05/22/2022  07:19 PM            76,586 Equilibration.2.xst
05/22/2022  07:19 PM                 5 Equilibration.3.check
05/22/2022  07:19 PM             2,906 Equilibration.3.conf
05/22/2022  07:20 PM         3,535,345 Equilibration.3.coor
05/22/2022  07:19 PM       265,186,276 Equilibration.3.dcd
05/22/2022  07:20 PM        10,974,500 Equilibration.3.log
05/22/2022  07:19 PM         1,060,588 Equilibration.3.restart.coor
05/22/2022  07:20 PM         1,060,588 Equilibration.3.restart.coor.old
05/22/2022  07:20 PM         1,060,588 Equilibration.3.restart.vel
05/22/2022  07:19 PM         1,060,588 Equilibration.3.restart.vel.old
05/22/2022  07:19 PM               291 Equilibration.3.restart.xsc
05/22/2022  07:20 PM               288 Equilibration.3.restart.xsc.old
05/22/2022  07:19 PM         3,535,344 Equilibration.3.vel
05/22/2022  07:19 PM               290 Equilibration.3.xsc
05/22/2022  07:19 PM            76,502 Equilibration.3.xst
05/22/2022  07:20 PM                 5 Equilibration.4.check
05/22/2022  07:20 PM             2,904 Equilibration.4.conf
05/22/2022  07:19 PM         3,535,345 Equilibration.4.coor
05/22/2022  07:19 PM       265,186,276 Equilibration.4.dcd
05/22/2022  07:20 PM        10,976,222 Equilibration.4.log
05/22/2022  07:19 PM         1,060,588 Equilibration.4.restart.coor
05/22/2022  07:19 PM         1,060,588 Equilibration.4.restart.coor.old
05/22/2022  07:19 PM         1,060,588 Equilibration.4.restart.vel
05/22/2022  07:19 PM         1,060,588 Equilibration.4.restart.vel.old
05/22/2022  07:19 PM               291 Equilibration.4.restart.xsc
05/22/2022  07:19 PM               290 Equilibration.4.restart.xsc.old
05/22/2022  07:20 PM         3,535,344 Equilibration.4.vel
05/22/2022  07:19 PM               290 Equilibration.4.xsc
05/22/2022  07:19 PM            76,569 Equilibration.4.xst
05/22/2022  07:19 PM                 5 Equilibration.check
05/22/2022  07:19 PM             2,867 Equilibration.conf
05/22/2022  07:19 PM         3,535,345 Equilibration.coor
05/22/2022  07:19 PM       265,186,276 Equilibration.dcd
05/22/2022  07:20 PM        10,972,568 Equilibration.log
05/22/2022  07:19 PM         1,060,588 Equilibration.restart.coor
05/22/2022  07:19 PM         1,060,588 Equilibration.restart.coor.old
05/22/2022  07:19 PM         1,060,588 Equilibration.restart.vel
05/22/2022  07:19 PM         1,060,588 Equilibration.restart.vel.old
05/22/2022  07:19 PM               291 Equilibration.restart.xsc
05/22/2022  07:19 PM               291 Equilibration.restart.xsc.old
05/22/2022  07:19 PM         3,535,344 Equilibration.vel
05/22/2022  07:19 PM               290 Equilibration.xsc
05/22/2022  07:20 PM            76,569 Equilibration.xst
05/22/2022  07:19 PM         3,535,357 Equilibration_restraints.pdb
05/22/2022  07:19 PM             2,696 FFTW_NAMD_2.14_Linux-x86_64-multicore-CUDA.txt
05/22/2022  07:19 PM                 5 MD.check
05/22/2022  07:19 PM             2,764 MD.conf
05/22/2022  07:20 PM         3,535,347 MD.coor
05/22/2022  07:22 PM     5,303,720,276 MD.dcd
05/22/2022  07:19 PM       220,184,341 MD.log
05/22/2022  07:19 PM         1,060,588 MD.restart.coor
05/22/2022  07:19 PM         1,060,588 MD.restart.coor.old
05/22/2022  07:22 PM         1,060,588 MD.restart.vel
05/22/2022  07:19 PM         1,060,588 MD.restart.vel.old
05/22/2022  07:20 PM               293 MD.restart.xsc
05/22/2022  07:20 PM               291 MD.restart.xsc.old
05/22/2022  07:19 PM         3,535,346 MD.vel
05/22/2022  07:20 PM               292 MD.xsc
05/22/2022  07:19 PM         1,537,412 MD.xst
05/22/2022  07:19 PM                 5 Minimization.check
05/22/2022  07:20 PM             2,828 Minimization.conf
05/22/2022  07:20 PM         3,535,344 Minimization.coor
05/22/2022  07:19 PM        13,259,576 Minimization.dcd
05/22/2022  07:19 PM        15,767,251 Minimization.log
05/22/2022  07:19 PM         1,060,588 Minimization.restart.coor
05/22/2022  07:19 PM         1,060,588 Minimization.restart.coor.old
05/22/2022  07:20 PM         1,060,588 Minimization.restart.vel
05/22/2022  07:19 PM         1,060,588 Minimization.restart.vel.old
05/22/2022  07:20 PM               217 Minimization.restart.xsc
05/22/2022  07:19 PM               217 Minimization.restart.xsc.old
05/22/2022  07:20 PM         3,535,343 Minimization.vel
05/22/2022  07:20 PM               216 Minimization.xsc
05/22/2022  07:19 PM               228 Minimization.xsc.BAK
05/22/2022  07:19 PM             2,218 Minimization.xst
05/22/2022  07:19 PM         3,535,357 Minimization_restraints.pdb
05/22/2022  07:20 PM                 0 Morikis_Non_PDBFix_20ns_Test4.e9933486
05/22/2022  07:19 PM                 0 Morikis_Non_PDBFix_20ns_Test4.o9933486
05/22/2022  07:19 PM                 0 Morikis_Non_PDBFix_20ns_Test4.pe9933486
05/22/2022  07:19 PM               285 Morikis_Non_PDBFix_20ns_Test4.po9933486
05/22/2022  07:19 PM         3,535,357 Morikis_Non_PDBFix_20ns_Test4_QwikMD.pdb
05/22/2022  07:19 PM         5,175,363 Morikis_Non_PDBFix_20ns_Test4_QwikMD.psf
05/22/2022  07:20 PM           151,831 par_all36_carb.prm
05/22/2022  07:20 PM           542,643 par_all36_cgenff.prm
05/22/2022  07:19 PM            29,404 par_all36_lipid.prm
05/22/2022  07:19 PM            62,276 par_all36_na.prm
05/22/2022  07:22 PM           188,120 par_all36_prot.prm
05/22/2022  07:19 PM             1,295 qwikmd_script
05/22/2022  07:19 PM            25,089 toppar_all36_carb_glycopeptide.str
05/22/2022  07:19 PM             8,053 toppar_water_ions_namd.str
             130 File(s)  7,062,505,197 bytes
               2 Dir(s)   5,260,062,720 bytes free

(base) J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run>

Therefore, I am not sure why I keep getting an error that the files cannot be accessed/opened. I also tested to see if the program would run on files downloaded to my local computer, and it does work. So, I believe there is an error in the code that prevents the path to a file on a mapped network drive from being properly resolved.

Part of the code from the program downloaded from GitLab is shown here:

import argparse
import os

from argparse import RawTextHelpFormatter
from contact_profile_calculator import main as profile_main, ALL_ATOM_CONTACT_CUTOFF,\
                                               ONLY_HEAVY_ATOM_CONTACT_CUTOFF,\
                                               CA_ATOM_CONTACT_CUTOFF, CB_ATOM_CONTACT_CUTOFF
from contact_similarity_calculator import main as similarity_main
from similarity_drawer import main as drawer_main, SIMILARITY_TANIMOTO, SIMILARITY_EUCLIDEAN
from similarity_plotter import main as plotter_main
from traj2pdb import convert

OUTPUT_SYSTEM_DIR = 'outputs'
OUTPUT_SIMILARITY_DIR = 'similarity'
OUTPUT_DRAWER_DIR = 'drawer'
OUTPUT_PLOTTER_DIR = 'plotter'


def run(args):
    """システム実行関数

    Args:
        args (NameSpace): 引数解析された名前空間
    """
    trajectory1 = args.trajectory1
    topology1 = args.topology1
    trajectory2 = args.trajectory2
    topology2 = args.topology2
    region = args.region
    contact_cutoff = None
    num_process = args.num_process
    out_dist_map = args.out_dist_map

    output_dir = os.path.join(os.getcwd(), OUTPUT_SYSTEM_DIR)

    # トラジェクトリ変換処理
    trajectory1_pdb = None
    if(os.path.splitext(os.path.basename(trajectory1))[1] == '.pdb'):
        trajectory1_pdb = trajectory1

    else:
        convert_output_dir = os.path.join(output_dir, 'convert1')
        convert(trajectory=trajectory1,
                topology=topology1,
                start=1,
                stop=-1,
                step=1,
                output_dir=convert_output_dir,
                disk_limit_usage=95.0)
        if(topology1.endswith('-out.cms')):
            trajectory1_pdb = os.path.join(
                convert_output_dir,
                os.path.basename(topology1).replace('-out.cms', '.pdb'))

        else:
            trajectory1_pdb = os.path.join(
                convert_output_dir,
                os.path.splitext(os.path.basename(trajectory1))[0] + '.pdb')

    trajectory2_pdb = None
    if(os.path.splitext(os.path.basename(trajectory2))[1] == '.pdb'):
        trajectory2_pdb = trajectory2

    else:
        convert_output_dir = os.path.join(output_dir, 'convert2')
        convert(trajectory=trajectory2,
                topology=topology2,
                start=1,
                stop=-1,
                step=1,
                output_dir=convert_output_dir,
                disk_limit_usage=95.0)
        if(topology2.endswith('-out.cms')):
            trajectory2_pdb = os.path.join(
                convert_output_dir,
                os.path.basename(topology2).replace('-out.cms', '.pdb'))

        else:
            trajectory2_pdb = os.path.join(
                convert_output_dir,
                os.path.splitext(os.path.basename(trajectory2))[0] + '.pdb')

    contact_profile_list = list()
    for trajectory in [trajectory1_pdb, trajectory2_pdb]:
        file_prefix = os.path.splitext(os.path.basename(trajectory))[0]
        profile_main(trajectory=trajectory,
                     region=region,
                     contact_cutoff=contact_cutoff,
                     num_process=num_process,
                     out_dist_map=out_dist_map,
                     target_atom=args.target_atom,
                     output_dir=os.path.join(output_dir, file_prefix))
        contact_profile_list.append(os.path.join(output_dir, file_prefix, 'contact_profile.csv'))

    output_similarity_dir = os.path.join(output_dir, OUTPUT_SIMILARITY_DIR)
    similarity_main(cp1=contact_profile_list[0],
                    cp2=contact_profile_list[1],
                    output_dir=output_similarity_dir)

    drawer_main(
        contact_profile_diff_file=os.path.join(output_similarity_dir, 'contact_profile_diff.csv'),
        similarity_table_file=os.path.join(output_similarity_dir, 'similarity_table.csv'),
        trajectory=trajectory1_pdb,
        exclude_region='',
        similarity_mode=args.similarity,
        output_dir=os.path.join(output_dir, OUTPUT_DRAWER_DIR))

    plotter_main(
        similarity_table_file=os.path.join(output_similarity_dir, 'similarity_table.csv'),
        bin=50,
        exclude_region='',
        output_dir=os.path.join(output_dir, OUTPUT_PLOTTER_DIR))


def profile(args):
    """contact_profile_calculator 実行関数

    Args:
        args (NameSpace): 引数解析された名前空間
    """
    trajectory = args.trajectory
    topology = args.topology
    contact_cutoff = None
    output_dir = os.path.splitext(os.path.basename(trajectory))[0]

    # トラジェクトリ変換処理
    trajectory_pdb = None
    if(os.path.splitext(os.path.basename(trajectory))[1] == '.pdb'):
        trajectory_pdb = trajectory

    else:
        convert_output_dir = os.path.join(os.getcwd(), 'convert')
        convert(trajectory=trajectory,
                topology=topology,
                start=1,
                stop=-1,
                step=1,
                output_dir=convert_output_dir,
                disk_limit_usage=95.0)
        if(topology.endswith('-out.cms')):
            trajectory_pdb = os.path.join(
                convert_output_dir,
                os.path.basename(topology).replace('-out.cms', '.pdb'))

        else:
            trajectory_pdb = os.path.join(
                convert_output_dir,
                os.path.splitext(os.path.basename(trajectory))[0] + '.pdb')

    profile_main(trajectory=trajectory_pdb,
                 region=args.region,
                 contact_cutoff=contact_cutoff,
                 num_process=args.num_process,
                 out_dist_map=args.out_dist_map,
                 target_atom=args.target_atom,
                 output_dir=output_dir)


def similarity(args):
    """contact_similarity_calculator実行関数

    Args:
        args (NameSpace): 引数解析された名前空間
    """
    similarity_main(cp1=args.contact_profile_1,
                    cp2=args.contact_profile_2,
                    output_dir=os.path.join(os.getcwd(), OUTPUT_SIMILARITY_DIR))


def drawer(args):
    """similarity_drawer 実行関数

    Args:
        args (NameSpace): 引数解析された名前空間
    """
    trajectory = args.trajectory
    topology = args.topology
    # トラジェクトリ変換処理
    trajectory_pdb = None
    if(os.path.splitext(os.path.basename(trajectory))[1] == '.pdb'):
        trajectory_pdb = trajectory

    else:
        convert_output_dir = os.path.join(os.getcwd(), 'convert')
        convert(trajectory=trajectory,
                topology=topology,
                start=1,
                stop=-1,
                step=1,
                output_dir=convert_output_dir,
                disk_limit_usage=95.0)
        if(topology.endswith('-out.cms')):
            trajectory_pdb = os.path.join(
                convert_output_dir,
                os.path.basename(topology).replace('-out.cms', '.pdb'))

        else:
            trajectory_pdb = os.path.join(
                convert_output_dir,
                os.path.splitext(os.path.basename(trajectory))[0] + '.pdb')

    drawer_main(
        contact_profile_diff_file=args.contact_profile,
        similarity_table_file=args.similarity_table,
        trajectory=trajectory_pdb,
        exclude_region=args.noregion,
        similarity_mode=args.similarity,
        output_dir=os.path.join(os.getcwd(), OUTPUT_DRAWER_DIR))


def plotter(args):
    """similarity_plotter 実行関数

    Args:
        args (NameSpace): 引数解析された名前空間
    """
    plotter_main(
        similarity_table_file=args.similarity_table,
        bin=args.bin,
        exclude_region=args.noregion,
        output_dir=os.path.join(os.getcwd(), OUTPUT_PLOTTER_DIR))


def get_argparser():
    parser = argparse.ArgumentParser(
        description='MDContactCom System'
    )

    subparsers = parser.add_subparsers(
        dest='subparser_name'
    )

    # システム実行コマンド
    parser_run = subparsers.add_parser(
        'run',
        description="Run MDContactCom Systems",
        formatter_class=RawTextHelpFormatter,
        help='see `run -h`'
    )
    parser_run.add_argument(
        'trajectory1',
        help='trajectory file is loaded by filename extension.\n'
             'Supported trajectory formats include ".pdb", ".dcd", ".dtr", ".xtc", ".mdcrd".'
    )
    parser_run.add_argument(
        '--topology1', '-top1',
        help='topology file is loaded by filename extension.\n'
             'Supported topology formats include ".pdb", ".cms", ".psf", ".prmtop".',
        type=str,
        default=None
    )
    parser_run.add_argument(
        'trajectory2',
        help='trajectory file is loaded by filename extension.\n'
             'Supported trajectory formats include ".pdb", ".dcd", ".dtr", ".xtc", ".mdcrd".'
    )
    parser_run.add_argument(
        '--topology2', '-top2',
        help='topology file is loaded by filename extension.\n'
             'Supported topology formats include ".pdb", ".cms", ".psf", ".prmtop".',
        type=str,
        default=None
    )
    parser_run.add_argument(
        '-r', '--region',
        help='Contact profile calculation target area\n'
             'Format: (<chain>):(<resnum>) \n'
             'Multiple specifications can be specified by separating them with ","',
        default=''
    )
    parser_run.add_argument(
        '-c', '--contact_cutoff',
        help='Contact judgment threshold.\n'
             'Option "-t 0". Defaults to  {0}.\n'
             'Option "-t 1". Defaults to  {1}.\n'
             'Option "-t 2". Defaults to  {2}.\n'
             'Option "-t 3". Defaults to  {3}.\n'.format(
                 ALL_ATOM_CONTACT_CUTOFF,
                 ONLY_HEAVY_ATOM_CONTACT_CUTOFF,
                 CA_ATOM_CONTACT_CUTOFF,
                 CB_ATOM_CONTACT_CUTOFF
             ),
        type=float
    )
    parser_run.add_argument(
        '-p', '--num_process',
        help='Number of processes.(Run on multiprocessing)',
        default=1,
        type=int
    )
    parser_run.add_argument(
        '-m', '--out_dist_map',
        help='Output an intermediate file (distance matrix).',
        action='store_true'
    )
    parser_run.add_argument(
        '-t', '--target_atom',
        help='Interaction analysis target atoms.\n'
             '0: All atoms\n'
             '1: Heavy atoms (Atoms excluding hydrogen atoms)[Default]\n'
             '2: CA atoms\n'
             '3: CB atoms\n',
        default=1,
        choices=[0, 1, 2, 3],
        type=int
    )
    parser_run.add_argument(
        '-s', '--similarity',
        help='Similarity coefficient to be visualized',
        type=str,
        choices=[SIMILARITY_TANIMOTO, SIMILARITY_EUCLIDEAN],
        default=SIMILARITY_TANIMOTO
    )
    parser_run.set_defaults(handler=run)

    # contact_profile_calculator 実行コマンド
    parser_profile = subparsers.add_parser(
        'profile',
        description="Run contact_profile_calculator",
        formatter_class=RawTextHelpFormatter,
        help='see `profile -h`'
    )
    parser_profile.add_argument(
        'trajectory',
        help='trajectory file is loaded by filename extension.\n'
             'Supported trajectory formats include ".pdb", ".dcd", ".dtr", ".xtc", ".mdcrd".'
    )
    parser_profile.add_argument(
        '--topology', '-top',
        help='topology file is loaded by filename extension.\n'
             'Supported topology formats include ".pdb", ".cms", ".psf", ".prmtop".',
        type=str,
        default=None
    )
    parser_profile.add_argument(
        '-r', '--region',
        help='Contact profile calculation target area\n'
             'Format: (<chain>):(<resnum>) \n'
             'Multiple specifications can be specified by separating them with ","',
        default=''
    )
    parser_profile.add_argument(
        '-c', '--contact_cutoff',
        help='Contact judgment threshold.\n'
             'Option "-t 0". Defaults to  {0}.\n'
             'Option "-t 1". Defaults to  {1}.\n'
             'Option "-t 2". Defaults to  {2}.\n'
             'Option "-t 3". Defaults to  {3}.\n'.format(
                 ALL_ATOM_CONTACT_CUTOFF,
                 ONLY_HEAVY_ATOM_CONTACT_CUTOFF,
                 CA_ATOM_CONTACT_CUTOFF,
                 CB_ATOM_CONTACT_CUTOFF
             ),
        type=float
    )
    parser_profile.add_argument(
        '-p', '--num_process',
        help='Number of processes.(Run on multiprocessing)',
        default=1,
        type=int
    )
    parser_profile.add_argument(
        '-m', '--out_dist_map',
        help='Output an intermediate file (distance matrix).',
        action='store_true'
    )
    parser_profile.add_argument(
        '-t', '--target_atom',
        help='Interaction analysis target atoms.\n'
             '0: All atoms\n'
             '1: Heavy atoms (Atoms excluding hydrogen atoms)[Default]\n'
             '2: CA atoms\n'
             '3: CB atoms\n',
        default=1,
        choices=[0, 1, 2, 3],
        type=int
    )
    parser_profile.set_defaults(handler=profile)

    # contact_similarity_calculator
    parser_similarity = subparsers.add_parser(
        'similarity',
        description="Run contact_similarity_calculator",
        formatter_class=RawTextHelpFormatter,
        help='see `similarity -h`'
    )
    parser_similarity.add_argument(
        'contact_profile_1',
        help='contact profile file',
        type=str
    )
    parser_similarity.add_argument(
        'contact_profile_2',
        help='contact profile file',
        type=str
    )
    parser_similarity.set_defaults(handler=similarity)

    # similarity_drawer
    parser_drawer = subparsers.add_parser(
        'drawer',
        description="Run similarity_drawer",
        formatter_class=RawTextHelpFormatter,
        help='see `drawer -h`'
    )
    parser_drawer.add_argument(
        'contact_profile',
        help='contact profile diff file.'
    )
    parser_drawer.add_argument(
        'similarity_table',
        help='Similarity table file.'
    )
    parser_drawer.add_argument(
        'trajectory',
        help='trajectory file is loaded by filename extension.\n'
             'Supported trajectory formats include ".pdb", ".dcd", ".dtr", ".xtc", ".mdcrd".'
    )
    parser_drawer.add_argument(
        '--topology', '-top',
        help='topology file is loaded by filename extension.\n'
             'Supported topology formats include ".pdb", ".cms", ".psf", ".prmtop".',
        type=str,
        default=None
    )
    parser_drawer.add_argument(
        '--noregion', '-n',
        help='Exclude residues.\n'
             'Format: (<chain>):(<resnum>) \n'
             'Multiple specifications can be specified by separating them with ","',
        default=''
    )
    parser_drawer.add_argument(
        '-s', '--similarity',
        help='Similarity coefficient to be visualized',
        type=str,
        choices=[SIMILARITY_TANIMOTO, SIMILARITY_EUCLIDEAN],
        default=SIMILARITY_TANIMOTO
    )
    parser_drawer.set_defaults(handler=drawer)

    # similarity_plotter
    parser_plotter = subparsers.add_parser(
        'plotter',
        description="Run similarity_plotter",
        formatter_class=RawTextHelpFormatter,
        help='see `plotter -h`'
    )
    parser_plotter.add_argument(
        'similarity_table',
        help='similarity table file',
        type=str
    )
    parser_plotter.add_argument(
        '--bin', '-b',
        help='Display width of graph scale. (Defalt 50)',
        type=int,
        default=50
    )
    parser_plotter.add_argument(
        '--noregion', '-n',
        help='Exclude residues.\n'
             'Format: (<chain>):(<resnum>) \n'
             'Multiple specifications can be specified by separating them with ","',
        default=''
    )
    parser_plotter.set_defaults(handler=plotter)

    return parser


def not_in_sub_cmd(argv: list) -> bool:
    """標準入力にサブコマンドが指定されているかを判断する関数

    Args:
        argv (list): コマンド実行時の標準入力: sys.argv

    Returns:
        bool: 指定のサブコマンドが含まれていない場合 TRUE
    """
    if(len(argv) < 2):
        return True

    subcommands = ['-h', 'run', 'profile', 'similarity', 'drawer', 'plotter']
    return argv[1] not in subcommands

Do I need to modify the code from the program in some way in order to be able to give files located on a mapped network drive as an input? Or is there a different way I need to be designating the path to the files when trying to run the program on the command line?

The error message says that you cannot access this file (I have deliberately split that over multiple lines to make it easier to read):

J:/pc

  /Computational_Experiments

  /Tests

  /Molecular_Dynamics_Simulations

  /QwikMD_or_NAMD

  /2XQW_Starting_Structure

  /Wildtype

  /Morikis_Non_PDBFix_20ns_Test4

  /Morikis_Non_PDBFix_20ns_Test4

  /run

  /MD.dcd

but it doesn’t say why you can’t access it. I hate programs that do that. The OS gives you an error code that at least hints what the problem is, and the program throws that information away so it becomes a mystery.

What are the permissions on that file?

Can you open it from the Windows Explorer? It looks like a 5GB file. Maybe it is too big and the network too slow. Or maybe anti-virus is interfering with it.

Try this:

pathname = 'J:/pc.../MD.dcd'  # same path as before

open(pathname, 'rb')

If that fails, copy and paste the full traceback, starting with the line Traceback... and ending with the full error message and post it here so we can see it.

Please try import os; print(os.stat(pathname)) before trying open(pathname, 'rb'). If os.stat() fails, you’ll get a more specific error message based on the Windows error code, whereas the error from open() is based on a mapped errno value.

When I look at the properties of that file in file explorer, it appears to be Read only:

I should mention that to access this file I do need to be on VPN. However, I have used other applications, such as VMD, and have been able to use this file as an input to perform calculations and things as long as I am connected to the VPN.

When I tried what you and @eryksun suggested, I see the following:

(base) C:\Users\Christos>python
Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> pathname = J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd
  File "<stdin>", line 1
    pathname = J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd
                ^
SyntaxError: invalid syntax
>>> pathname = 'J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Struct
>>> import os; print(os.stat(pathname))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'J:\\pc\\Computational_Experiments\\Tests\\Molecular_Dynamics_Simulations\\QwikMD_or_NAMD\x02XQW_Starting_Structure\\Wildtype\\Morikis_Non_PDBFix_20ns_Test4\\Morikis_Non_PDBFix_20ns_Test4\run\\MD.dcd'
>>> open(pathname, 'rb')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument: 'J:\\pc\\Computational_Experiments\\Tests\\Molecular_Dynamics_Simulations\\QwikMD_or_NAMD\x02XQW_Starting_Structure\\Wildtype\\Morikis_Non_PDBFix_20ns_Test4\\Morikis_Non_PDBFix_20ns_Test4\run\\MD.dcd'

So without a single quote surrounding the path, it did not accept saving the variable pathname. Once I added the quote and then tried the suggested commands, it appears that python is adding an extra \ between each folder, and that between folders QwikMD_or_NAMD and 2XQW_Starting_Structure an x0 is added. Should I try making the 2XQW_Starting_Structure folder name not start with a number? I am not sure what this means or how to solve this. Please let me know if you need any additional information.

You need to put the file’s pathname in quotes.

If you are using backslashes, you should prefix the quotes with a “r” for “raw-string”, to prevent the backslashes from being treated as string escape codes.

pathname = r'J:\pc\Computational_Experiments ... \MD.dcd'

Sorry, I should have mentioned this earlier.

Then try this:

f = open(pathname, 'rb')
data = f.read(64)
print(len(data))
f.close()

and report what happens.

If this works without any errors, proving that Python can in fact access the file and read from it, but the script does not, then it is probably a bug in the script that should be reported to its author.

1 Like

Oh, and also report on the output of what Eryksun asked for:

import os
print(os.stat(pathname))

The results you got previously without the r prefix on the string are suspect, please repeat them using the r prefix.

(Remember, the r goes on the outside of the quotes, not inside the quotes: r'J...' not 'rJ...'.)

I have redone the commands according to your instructions and this is what I see:

(base) C:\Users\Christos>python
Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> pathname = r'J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd'
>>> f = open(pathname, 'rb')
>>> data = f.read(64)
>>> print(len(data))
64
>>> f.close()
>>> import os
>>> print(os.stat(pathname))
os.stat_result(st_mode=33206, st_ino=25467662, st_dev=2484196055, st_nlink=1, st_uid=0, st_gid=0, st_size=5303720276, st_atime=1655144716, st_mtime=1653243725, st_ctime=1653243725)

I assume this means python can in fact access the files?

If this is the case, shouldn’t putting r’/path/to/file’ when I am calling the program fix the issue? I just tried this and it does not work:

(base) C:\Users\Christos\Downloads\mdcontactcom-master\mdcontactcom-master>python mdcontactcom run r'J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd' -top1 r'J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\Morikis_Non_PDBFix_20ns_Test4_QwikMD.psf' r'J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Mutants\C3d_L116V_aka1109_mutant\L116V_aka1109_20ns_Test1\L116V(1109)_20ns_Test1\run\MD.dcd' -top2 r'J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Mutants\C3d_L116V_aka1109_mutant\L116V_aka1109_20ns_Test1\L116V(1109)_20ns_Test1\run\L116V(1109)_20ns_Test1_QwikMD.psf'
2022-06-13 20:38:56,810 - traj2pdb.py - Func: convert                   - ERROR    - Error: Not Found File: r'J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd'

No, don’t pass raw string literals on the command line. The file paths are passed as quoted command-line arguments. Use double quotes, not single quotes. For example, python mdcontactcom run "J:\path\to\file". Windows applications get the command line as a string. They can parse it however they want. Python lets the Windows C runtime parse the command-line string into an array of arguments according to the rules that are detailed in Parsing C++ command-line arguments.

Personally, I’d use shell variables to help manage such a long command line. For example:


set "SS0=J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations"
set "SS1=%SS0%\QwikMD_or_NAMD\2XQW_Starting_Structure"

set "WT0=%SS1%\Wildtype\Morikis_Non_PDBFix_20ns_Test4"
set "WT1=%WT0%\Morikis_Non_PDBFix_20ns_Test4\run"
set "DCD1=%WT1%\MD.dcd"
set "PSF1=%WT1%\Morikis_Non_PDBFix_20ns_Test4_QwikMD.psf"

set "MT0=%SS1%\Mutants\C3d_L116V_aka1109_mutant"
set "MT1=%MT0%\L116V_aka1109_20ns_Test1\L116V(1109)_20ns_Test1\run"
set "DCD2=%MT1%\MD.dcd"
set "PSF2=%MT1%\L116V(1109)_20ns_Test1_QwikMD.psf"

python mdcontactcom run "%DCD1%" -top1 "%PSF1%" "%DCD2%" -top2 "%PSF2%"

Yes the command line is long, so I will consider using shell variables once I can get the program to work. Thank you for the instructions on how to do so.

When I try to run the program using double quotes around the paths, I still get the same error that the file cannot be accessed:

(base) C:\Users\Christos\Downloads\mdcontactcom-master\mdcontactcom-master>python mdcontactcom run "J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd" -top1 "J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\Morikis_Non_PDBFix_20ns_Test4_QwikMD.psf" "J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Mutants\C3d_L116V_aka1109_mutant\L116V_aka1109_20ns_Test1\L116V(1109)_20ns_Test1\run\MD.dcd" -top2 "J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Mutants\C3d_L116V_aka1109_mutant\L116V_aka1109_20ns_Test1\L116V(1109)_20ns_Test1\run\L116V(1109)_20ns_Test1_QwikMD.psf"
dcdplugin) Could not access file 'J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd'.
2022-06-13 22:40:06,123 - traj2pdb.py - Func: convert                   - ERROR    - Could not open file: J:\pc\Computational_Experiments\Tests\Molecular_Dynamics_Simulations\QwikMD_or_NAMD\2XQW_Starting_Structure\Wildtype\Morikis_Non_PDBFix_20ns_Test4\Morikis_Non_PDBFix_20ns_Test4\run\MD.dcd

Based on the tests I did earlier with python, does this mean that there is something wrong with the program? I do not really understand how it would be possible for the program to be able to follow the path to files on my local computer but have an error when trying to access files on a mapped network drive. As I mentioned the program does work if I use example files that are located on my local computer. But the files I need to analyze cannot be transferred to my local computer so the program needs to work with files on the mapped drive as the input

This error comes from open_dcd_read() in the dcdplugin of pymol. This exact error message only occurs if the C stat() call fails. The function ignores the C errno value, but the problem is likely that the file size (4.94 GiB) is too big, with errno set to EOVERFLOW. If the plugin links with the Windows C runtime implementation of stat(), then it’s implemented as _stat64i32(), which limits st_size to a 32-bit signed range (up to 2 GiB). A 64-bit size range is implemented by _[w]stat64(), but that’s not a standard POSIX call for cross-platform code.

1 Like

Nice diagnosis Eryk Sun, thanks for your assistance.

In practical terms, what does this mean for Christos? Is that something he can fix, or does he have to report it as a bug to the developer or use a smaller file?

The problem would need to be reported on the PyMOL repo. The most direct resolution would be to implement a wrapper function for stat() that calls _stat64() in Windows and returns a cross-platform stat result.

1 Like

Is this a Windows specific problem with the dcd plugin in PyMOL? So if I instead tried to download the program and all of the prerequisites on a virtual ubuntu machine, would it work? Or is the 2 GB limit for the dcd plugin true regardless of where I try to run this program?

Thank you for the help and sorry if I ask questions that do not make sense! This is above my level of knowledge in terms of computers.

Yes, in particular it’s a limitation of the implementation of POSIX stat() that the Windows C runtime library provides.

The DCD plugin in PyMOL should support a 5 GiB file in Linux. You can run Python in Linux by way of the Windows Subsystem for Linux (WSL) or a virtual machine. WSL is lighter on resource usage and integrated with Windows. You could also try using MSYS2 or Cygwin if PyMOL is available.

1 Like

Thanks for the advice. I just tried it in WSL2 and it didn’t seem to have the same issue but it still did not work. I entered the command and nothing happened for several hours; I just checked again and it just says “Killed” below the command. I assume this is again a size issue? Is there a way to turn off any sort of running time limit so it does not kill the process?

It looks like a memory hungry program issue… :slight_smile: What are the expected memory requirements of the program?

Normally shell shows the message Killed when the program was terminated by signal SIGKILL.

This suggest with a very high probability that the program was killed by “OOM killer” (out of memory killer). This is a part of Linux kernel which allows the system to continue operating when its virtual memory is exhausted. It selects a suitable process and kills it with SIGTERM or SIGKILL to free the virtual memory.

See for example: Understanding the Linux oom-killer’s logs

Unfortunately Linux distributions inside WSL are stripped of practically all the usual daemons so you will probably not find kernel logs on the disk but you can check them using dmesg. Nice colored output:

dmesg -H -Lalways | less -R

Check for the oom-killer messages as shown in the StackOverflow article above.

You can try to increase the RAM allocated to WSL2 but probably not much. On my system it gets 12 GB of my physical 16 GB. You can also try to increase the swap size. It could prevent the killing but performance can become extremely low when the swap gets heavily used. Use for example vmstat 1 to see swap-in and swap-out events.

Here is an article about adjusting the WSL2 memory: Understanding your WSL2 RAM and swap - Changing the default 50%-25%