def printContigSetup(FH, tabCount, inputBam, inputBamIndex, rmDup):
    """This needs to be able to handle GATK post-processing as well

    !!!!!!!!!!!!!!!!!!!!!!! NEEDS REFINEMENT !!!!!!!!!!!!!!!!!!!!!!!

    Does not look like that switch is properly implemented"""
    tabs = tabCount * '\t'
    alignment = True
    if alignment:
        contigBam = 'alnSampleContigBams[idx]'
    else:
        contigBam = 'contigBam'
    Str = (tabs + 'file[string] contigBams;\n' + tabs +
        """file[string] contigBamsIndex;

""" + tabs +
        '# Processed (genotyping ready) contig bams will be stored here\n' +
        tabs + """foreach contigName, idx in genomeContigs {
""" + tabs +
        '\t' + '# id for each contig\n' + tabs + '\t' +
        """# ".aln" has been removed to improve flexibility
""" + tabs +
        '\t' + 'string contigID = strcat(sample.ID,".",contigName);\n\n')
    """
    # Keep this around for if genotyping
    tabs + '	' + '# split into contig
' +
    tabs + '	' + '# Might be helpful to generate the index here
' +
    tabs + '	' + 'file contigBam <single_file_mapper; file=strcat(sample.dir,"/",contigID,".contig.bam")>;
' +
    tabs + '	' + 'file contigBamLog <single_file_mapper; file=strcat(sample.dir,"/",contigID,".contig.log")>;
' +
    tabs + '	' + '(contigBamLog,contigBam) = SamtoolsParseContig (' + inputBam + ',' + inputBamIndex + ',contigID,sample.dir,contigName);

')
    """
    rmDupStr = tabs + '\t' + '# rm dup\n' + tabs + '\t' + """file contigDupLog <single_file_mapper; file=strcat(sample.dir,"/",contigID,".contig.dup.log")>;
""" + tabs + '\t' + """file contigDupBam <single_file_mapper; file=strcat(sample.dir,"/",contigID,".contig.dup.bam")>;
""" + tabs + '\t' + """file contigDupMetrics <single_file_mapper; file=strcat(sample.dir,"/",contigID,".contig.dup.metrics")>;
""" + tabs + '\t' + '(contigDupLog,contigDupBam,contigDupMetrics) = PicardMarkDuplicates (' + contigBam + """,contigID,sample.dir);

"""
    if rmDup:
        outputBam = 'contigDupBam'
        FH.write(Str + rmDupStr)
    else:
        outputBam = contigBam
        FH.write(Str)
    return outputBam
