Sequence annotation pipeline user Kantale

From PyPedia
Jump to: navigation, search

Contents

[edit] Documentation

Documentation for Sequence annotation pipeline


[edit] Parameters

<inputs>
</inputs>


[edit] Return

[edit] See also

[edit] Code

def Sequence_annotation_pipeline_user_Kantale(
	input_filename = None,
	constants = None,
	temp_dir = None,
	results_dir = None,
	chromosome_column_of_input = 0,
	start_column_of_input = 1,
	end_column_of_input = 2,
	reference_column_of_input = 3,
	observed_column_of_input = 4,
	use_first_line_from_input_as_header = True,
	buildver = "hg18",
	gene_based_annotations = "refgene,knowngene,ensgene",
	region_based_annotations = "band,segdup,dgv,gwascatalog",
	filter_based_annotations = "snp130",
	custom_annotations = None,
):

	#Input check
	if type(use_first_line_from_input_as_header).__name__ != "bool":
		raise Exception("use_first_line_from_input_as_header need to be defined")
		if not use_first_line_from_input_as_header:
			raise Exception("use_first_line_from_input_as_header should be True. Input should have a header.")
	

	if buildver != "hg18":
		raise Exception("Build version: " + str(buildver) + " is not supported")

	lock_filename = temp_dir + "/delete.me"

	lock_file = open(lock_filename, "w")
	lock_file.close()

	pipeline = []

	pipeline += [{
		"name" : "push the button",
		"command" : "Wait_while_file_exists",
		"params" : {
			"filename" : lock_filename
			},
		"prereq" : [],
		"mem" : "1GB",
		"walltime" : "1:00:00",
		}]

	pipeline += [{
		"name" : "Annotate with annovar",
		"command" : "AnnotateTABFilenameViaANNOVAR",
		"params" : {
			"pathToANNOVAR" : constants["path_to_annovar"],
			"outputDirectory" : results_dir,
			"outputFilename" : "output_annovar.txt",
			"buildver" : buildver,
			"inputFilename" : input_filename,
			"chromosomeColumnOfInputFilename" : chromosome_column_of_input,
			"startColumnOfInputFilename" : start_column_of_input,
			"endColumnOfInputFilename" : end_column_of_input,
			"referenceColumnOfInputFilename" : reference_column_of_input,
			"observedColumnOfInputFilename" : observed_column_of_input,
			"useFirstLineFromInputAsHeader" : use_first_line_from_input_as_header,
			"annotationDirectory" : constants["path_to_annovar_annotation_files_hg18"],
			"geneBasedAnnotations" : gene_based_annotations,
			"regionBasedAnnotations" : region_based_annotations,
			"filterBasedAnnotations" : filter_based_annotations,
			"customAnnotations" : custom_annotations,
			"pbsStats" : None,
			},
		"prereq" : ["push the button"],
		"mem" : "4GB",
		"walltime" : "4:00:00",
		}]

	pipeline += [{
		"name" : "Geno Ontology Annotation",
		"command" : "AnnotateListOfChromosomePositionFilesWithGOFromBioMartEnsembl",
		"params" : {
			"listOfFilesToAnnotate" : [results_dir + "/output_annovar.txt"],
			"numberOfFirstLinesToIgnoreInFileToAnnotate" : [1],
			"chromosomeColumnOfFilesToAnnotate" : [0],
			"positionColumnOfFilesToAnnotate" : [1],
			"fileWithGOAnnotation" : constants["path_to_gene_ontology_36"],
			"fileWithGOAnnotationChromosomeColumn" : 1,
			"fileWithGOAnnotationStartColumn" : 2,
			"fileWithGOAnnotationEndColumn" : 3,
			"columnsWithGOAnnotationComaSeparated" : "4,5,6,7,8,9",
			"numberOfFirstLinesToIgnoreInGOAnnotationFile" : 1,
			"outputDirectory" : results_dir,
			"outputFilename" : "output_GO",
			},
		"prereq" : ["Annotate with annovar"],
		"mem" : "4GB",
		"walltime" : "4:00:00",
		}]

	pipeline += [{
		"name" : "Allele Frequencies Annotation",
		"command" : "AnnotateTABFileWithAlleleFrequencies",
		"params" : {
			"filesToBeAnnotated" : [results_dir + "/output_GO.GO"],
			"chromosomeColumnOfFileToBeAnnotated" : 0,
			"positionColumnOfFileToBeAnnotated" : 1,
			"readHeaderFromFirstLineFromFileToBeAnnotated" : True,
			"alleleFrequencyFiles" : None,
			"outputFilenames" : results_dir + "/output.txt",
			},
		"prereq" : ["Geno Ontology Annotation"],
		"mem" : "4GB",
		"walltime" : "4:00:00",
		}]

	return pipeline

[edit] Unit Tests

def uni1():
	return True

[edit] Development Code

def Sequence_annotation_pipeline_user_Kantale():
	pass

[edit] Permissions

[edit] Documentation Permissions

Kantale

[edit] Code Permissions

Kantale

[edit] Unit Tests Permissions

Kantale

[edit] Permissions Permissions

Kantale

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox