#!/usr/bin/env python

#executing script creating disordered sequence variants from command line.

#import stuff for making CLI
import os
import sys
import argparse

#import csv
import csv

from pipit.shuffle import shuffle_seq

parser = argparse.ArgumentParser(description='Create specific shuffled sequences.')
parser.add_argument('sequence', type=str, help='The protein sequence to shuffle.')
parser.add_argument('start', type=int,
                    help='The starting amino acid number to define your region to either shuffle or keep constant')
parser.add_argument('end', type=int,
                    help='The ending amino acid number to define your region to either shuffle or keep constant')
parser.add_argument('-n', '--number', type=int, default=1, metavar='number_blocks',
                    help='The number of blocks to divide the sequence to be shuffled into')
parser.add_argument('-i', '--inverse', action='store_true', 
                    help='If this flag is used, the region defined will be kept constant and regions outside of that will be shuffled.')

args = parser.parse_args()

if args.inverse:
    inverse=True
else:
    inverse=False
print(shuffle_seq(args.sequence, start=args.start, end=args.end, number_blobs=args.number, inverse=inverse))
