def transDataRow(origins, pep, protDict):
    """
    Called by writeToFasta(), this function takes the trans origin data for a given peptide and formats it for writing
    to the csv file.

    :param origins: the data structure containing information on where a given peptide was found within the input
    proteins. Has the form: [[protName, startIndex, endIndex]..] where each sublist refers to the location of an
    individual cleavage which can be combined with another cleavage somewhere in the protein file to create the peptide.
    :param pep: the peptide which the origin data related to.
    :param protDict: a dictionary containing the input protein data. This is needed to return slight differences in the
    peptide and origin due to the program not treating I/J differently.
    :return dataRows: a list of lists, where each sublist is a row of data which is to be written to file. Each sublist
    has the format: [protName, peptide, pepInProt, location]
    """
    dataRows = []
    for location in origins:
        if location == True:
             dataRow = [pep, "Formed only by cleavages under max length."]
             dataRows.append(dataRow)
        else:
            protName = location[0]
            startRef = location[1]
            endRef = location[2] + 1
            pepInProt = protDict[protName][startRef:endRef]
            dataRow = [location[0], pep, pepInProt, [startRef + 1, endRef]]
            dataRows.append(dataRow)
    return dataRows