#NEWLINE# def _calldata_arities( fields , arities , format_counts , ploidy ) : #NEWLINE# #INDENT# if ( arities is None ) : #NEWLINE# #INDENT# arities = dict ( ) #NEWLINE# #UNINDENT# for ( f , vcf_count ) in zip ( fields , format_counts ) : #NEWLINE# #INDENT# if ( f not in fields ) : #NEWLINE# #INDENT# if ( f == 'genotype' ) : #NEWLINE# #INDENT# arities [ f ] = ploidy #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( f in config . DEFAULT_CALLDATA_ARITY ) : #NEWLINE# #INDENT# arities [ f ] = config . DEFAULT_CALLDATA_ARITY [ f ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( vcf_count == NUMBER_ALLELE ) : #NEWLINE# #INDENT# arities [ f ] = 2 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( vcf_count == NUMBER_GENOTYPE ) : #NEWLINE# #INDENT# arities [ f ] = ( ploidy + 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( vcf_count <= 0 ) : #NEWLINE# #INDENT# arities [ f ] = 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# arities [ f ] = vcf_count #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return tuple ( ( arities [ f ] for f in fields ) )