spider.utils module

class spider.utils.SpiderDocAliFile(filename, mode='r')[source]

Bases: object

Handler class to read Spider alignment metadata.

close()[source]
class spider.utils.SpiderDocFile(filename, mode='r')[source]

Bases: object

Handler class to read/write spider docfile.

close()[source]
fixHeaders(headers)[source]

make all headers 11 characters in width; return doc string

iterValues()[source]
makeDocfileHeader(filename, batext=None)[source]

create the comment line used at the top of SPIDER document files

nowisthetime(dt=None, fmt='%d-%b-%Y AT %H:%M:%S')[source]
writeComment(filename, batext='spi')[source]
writeHeader(fields)[source]
writeValues(*values)[source]

Write values in spider docfile.

class spider.utils.SpiderShell(ext='spi', **kwargs)[source]

Bases: object

This class will open a child process running Spider interpreter and will keep connection to send commands.

close(end=True)[source]
runCmd(cmd)[source]
runFunction(funcName, *args)[source]
spider.utils.runCustomMaskScript(filterRadius1, sdFactor, filterRadius2, maskThreshold, workingDir, ext='stk', inputImage='input_image', outputMask='stkmask')[source]

Utility function to run the custommask.msa script. This function will be called from the custom mask protocol and from the wizards to create the mask.

spider.utils.runScript(inputScript, ext, program, nummpis, log=None, cwd=None)[source]
spider.utils.runTemplate(inputScript, ext, paramsDict, nummpis=1, program=None, log=None, cwd=None)[source]

This function will create a valid Spider script by copying the template and replacing the values in dictionary. After the new file is read, the Spider interpreter is invoked. Usually the execution should be done where the results will be left.

spider.utils.writeScript(inputScript, outputScript, paramsDict)[source]

Create a new Spider script by substituting params in the input ‘paramsDict’.