ST 1.84.4, my translation. This is still a bit rough. For comparison, you can find the Latin here and the Dominican Fathers translation here.
It seems that it should not be said that there are seven capital vices, which are vainglory, envy, wrath, sorrow, avarice, gluttony, and lust.
(1) For sins are opposed to virtues, but there are four principal virtues, as was said above. Therefore also principal or capital vices are not other than four.
(2) Further, the passions of the soul are causes of sins, as was said above. But the passions of the soul are four. Two of these are not mentioned among the aforesaid sins, namely, hope and fear. And there are enumerated various vices to which pertain delight and sorrow, since delight pertains to gluttony and lust, and sorrow to sloth and envy. Therefore the principal sins are enumerated inappropriately.
(3) Further, wrath is not a principal passion. Therefore it ought not to be placed among the principal vices.
(4) Further, just as cupidity, or avarice, is the root of sin, so pride is the beginning of sin, as was said above. But avarice is placed as one of the seven capital vices, so pride should be enumerated among the capital vices.
(5) Further, some sins are committed which can be caused by none of these, as when someone sins out of ignorance; or when someone commits a sin from a good intention, as when someone steels in order to give alms. Therefore the capital vices are not completely enumerated.
But on the contrary there is the authority of Gregory, who enumerates them so in XXXI Moralium.
I reply that it must be said that, as was said, the capital vices are those from which others rise, particularly according to the notion of final cause. But in two ways may this kind of origination take place.  In one way, according to the condition of the sinner, who is disposed so as to have the greatest inclination for one end, so that he often proceeds to other sins. But this mode of origination cannot fall under art, for particular human dispositions are infinite.  In another way, according to the natural tendency of the ends, one to another; and it is in this way that often one vice often gives rise to another; wherefore this mode of origination can fall under art.
In this way, then, those vices are said to be capital whose ends have certain primary reasons for moving desire, and it is according to these distinctive reasons that the capital vices are distinguished. But something moves desire in two ways.  In one way, directly and through itelf, and thus good moves desire to seek it and evil, for the same reason to flee it.  In another way, indirectly and as it were through another, as when someone seeks some evil due to some adjoined good, someone seeks evil due to some adjoined evil.
But human good is threefold.  For in the first place, there is a sort of good of the soul, which has the notion of desirability solely from being apprehended, namely the excellence of praise and honor, and this good is sought in a disordered way by vainglory.  Another is good of the body, and to this pertains either to the conservation of the individual, as with food and drink, and this good is pursued in a disordered way by gluttony, or to conservation of the species, such as sex, and to this lust is ordered.  Third is exterior good, such as riches, and to this is ordered avarice. And these four vices inordinately flee the contrary evils.
Or otherwise, good chiefly moves desire from the fact that it participates some property of happiness, which all naturally desire.  This conceptually (de cuius ratione) involves some kind of completion, for happiness is complete good, to which pertains excellence or clarity, which pride or vainglory desires.  Second, it conceptually involves sufficiency, which avarice desires in riches that promise this.  Third, it implies delight, without which happiness cannot be, as is said in Ethics I and X, and this is desired by gluttony and lust.
But that someone flees good due to some conjoined evil happens in two ways.  For this is either with regard to one's own good, and this is sloth, which is to sorrow at spiritual good due to the adjoined bodily labor, or  with regard to another person's good, and this, if it is without insurrection, pertains to envy, which is to sorrow at another's good, insofar as it impedes one's own excellence, or it is with a sort of insurrection in pursuit of vindication, and this is wrath. And to these same vices pertains the search for opposite evils.
(1) To the first it must be said that the same notion of origination is not found in virtues and vices, for virtues are caused by the ordering of desire to reason, or to immutable good, which is God; but vice is raised up from desire for mutable good. Wherefore there is no need for the principal vices to be opposed to the principal virtues.
(2) To the second it must be said that fear and hope are irascible passions. But all irascible passions are raised up from concupiscible passions, and these are all ordered in some way to delight and sorrow. Thus delight and sorrow are principally counted in the capital sins, in being the most principal passions, as was had above.
(3) To the third it must be said that wrath, despite not being a principal passion, is allowed because conceptually it involves movement of desire, in that to fight another's good suggests the notion of noble good, that is, of the right of vindication; thus it is distinguished from other capital vices.
(4) To the fourth it must be said that pride is said to be the beginning of all sin according to the notion an end, as was said. And according to this same notion it is accorded pre-eminence over the capital vices (principalitas vitiorum capitalium). And thus pride, as it were a universal vice (quasi universale vitium) is not counted among but is rather placed as the queen of all the vices (regina omnium vitiorum), as Gregory says. But avarice is said to be the root according to another notion, as was said above.
(5) To the fifth it must be said that these vices are said to be capital because from them others are frequently raised. Wherefore nothing prevents some sins from arising from other causes. Nonetheless we can say that all sins coming from ignorance can be traced back to sloth, to which pertains the negligence of someone who declines to acquire spiritual goods as a result of labor; for the ignorance that can be a cause of sin comes from negligence, as was said above. And that someone may commit some sin from a good intention is seen to pertain to ignorance, inasmuch as he is ignorant of the fact that evil should not be done so that good may come.