Member Site › Forums › PyRosetta › PyRosetta – General › I don’t know what’s the problem when load the fragment file
- This topic has 5 replies, 3 voices, and was last updated 9 years, 11 months ago by
Anonymous.
-
AuthorPosts
-
-
September 29, 2014 at 10:45 am #2012
Anonymous
Hello ~
I’m interested in Pyrosetta
and learning the tutorial
Workshop #4: PyRosetta Folding
page 4
11. Create a new subroutine in your folding code for an alternate random move based upon a “fragment insertion”. A fragment insertion is the replacement of the torsion angles for a set of consecutive residues with new torsion angles pulled at random from a fragment library file. Prior to calling the subroutine, load the set of fragments from the fragment file:
fragset = ConstantLengthFragSet(3)
fragset.read_fragment_file(“aatestA03_05.200_v1_3”)so I did the same work and it said just error
In [3] : fragset = ConstantLengthFragSet(3)In [4] :fragset.read_fragment_file(“test/data/workshops/aat000_03_05.200_v1_3”)
Open failed for file :
←[0m←[1m←[31mERROR: : Exit from:core/fragment/ConstantLengthFragSet.cc line: 117
←[0m
RuntimeError Traceback(most recent call last)
in ()
> fragset.read_fragment_file(“test/data/workshops/aat000_03_05.200_v1_3”)
RuntimeError: unidenifiable C++ exceptionIn [5] :
How can I solve his error?
please tell me what’s the wrong. -
September 29, 2014 at 11:06 am #10345
Anonymous
Are you sure the file exists?
Do you get any output by calling
!tail “test/data/workshops/aat000_03_05.200_v1_3”
in IPython?
-
September 29, 2014 at 12:09 pm #10346
Anonymous
Yes. aat000_03_05.200_v1_3 file exsist in workshop
-
September 29, 2014 at 10:11 pm #10361
Anonymous
One possibility is issues with path. If the path you’re running python out of (or more particularly, the one which Rosetta thinks it’s running out of) is not the same as the one that’s the base of the relative file path you give, then you’ll get file missing errors.
Instead of giving a relative path, try giving the full, absolute path. For example, if test/data/workshops/aat000_03_05.200_v1_3 is actually located at /home/john/pyrosetta/workshop/workshop4/test/data/workshops/aat000_03_05.200_v1_3 then use “fragset.read_fragment_file(‘/home/john/pyrosetta/workshop/workshop4/test/data/workshops/aat000_03_05.200_v1_3’)”
-
September 30, 2014 at 3:22 am #10364
Anonymous
Thanks
but It doesn’t work
I check that the file really exsist byIn [6] : !aat000_03_05.200_v1_3
and find the path by using
In [7] : os.path.abspath(“aat000_03_05.200_v1_3”)
‘C:\Python27\aat000_03_05.200_v1_3’and Last I put it into ]
In [8] : fragset = ConstantLengthFragSet(3)
In [9] : fragset.read_fragment_file(os.path.abspath(“aat000_03_05.200_v1_3”)
But…..In [9] : fragset.read_fragment_file(os.path.abspath(“aat000_03_05.200_v1_3”))
Open failed for file :
←[0m←[1m←[31mERROR: : Exit from:core/fragment/ConstantLengthFragSet.cc line: 117
←[0m
RuntimeError Traceback(most recent call last)
in ()
> fragset.read_fragment_file(os.path.abspath(“aat000_03_05.200_v1_3”))
RuntimeError: unidenifiable C++ exceptionSo……..Maybe path won’t be the problem……
then what might be the problem?? -
September 30, 2014 at 8:16 pm #10374
Anonymous
os.path.abspath() only makes a path according to what Python thinks the path should be according to the path given and the current directory — it doesn’t search for it, and it doesn’t actually confirm that there’s a file there. You would need to use os.path.exists() to test for existence. I’m highly suspecting that os.path.exists(os.path.abspath(“aat000_03_05.200_v1_3”)) returns false for you.
That would explain why you’re getting the initial error – Python (and possibly PyRosetta) is expecting relative file paths to be based off of the C:Python27 directory, rather than where it actually is. The file C:Python27test/data/workshops/aat000_03_05.200_v1_3 doesn’t actually exist, hence the message that you can’t open the file.
What you need to do is *manually* find the complete path to the file in question. Open up a file system explorer window and navigate to the file. Typically there’s a path indication in the filesystem browser window. Type this out manually in your Python session. Check that Python thinks that file exists with the os.path.exists(). If it doesn’t, check that the path is indeed correct and you haven’t mistyped something. (Keep in mind that the backslashes need to be escaped in Python strings, so it’s “\” rather than “” as a path separator.) Once you get os.path.exists() to return true for that path, then pass that full path to the PyRosetta functions.
-
-
AuthorPosts
- You must be logged in to reply to this topic.